The OpenAI Normalizer component leverages OpenAI’s GPT model to intelligently normalize and structure grocery or food item data from unstructured text (like receipts or shopping lists).It transforms messy product names into canonical, structured JSON — identifying the item’s standard name, quantity, and whether it is organic.
This component is especially useful for:
Grocery receipt parsing
Inventory standardization
Product data cleaning before analytics
Importing external datasets with inconsistent naming
Input:
organic milk 1L CKN BRST 1KG ORG Ambrosia apple juice 2L
Output:
{ "items": [ { "name": "Milk", "quantity": "1L", "organic": true }, { "name": "Chicken Breast", "quantity": "1KG", "organic": true }, { "name": "Apple Juice", "quantity": "2L", "organic": false } ] }
API Endpoint:https://api.openai.com/v1/chat/completions
https://api.openai.com/v1/chat/completions
Model Used:gpt-4o-mini
gpt-4o-mini
Request Format:
{ "model": "gpt-4o-mini", "messages": [ { "role": "system", "content": "You are a grocery receipt normalizer. Return structured JSON only. For product names, always use canonical names." }, { "role": "user", "content": "organic milk 1L\nCKN BRST 1KG ORG\nAmbrosia apple juice 2L" } ], "temperature": 0 }
Response Example:
{ "id": "chatcmpl-CIuKpQjvvO1qMizjaTTc506yF9Rq8", "object": "chat.completion", "model": "gpt-4o-mini-2024-07-18", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "{ \"items\": [ { \"name\": \"Milk\", \"quantity\": \"1L\", \"organic\": true }, { \"name\": \"Chicken Breast\", \"quantity\": \"1KG\", \"organic\": true }, { \"name\": \"Apple Juice\", \"quantity\": \"2L\", \"organic\": false } ] }" } } ] }
✅ Cleans and normalizes food item names into canonical English terms✅ Detects quantities and units (e.g., 1L, 500g, 2kg)✅ Identifies “organic” items from common keywords✅ Outputs JSON data ready for storage or analytics✅ Can be easily integrated with OutSystems Data Models, Entities, and REST Integrations
Install the Component from Forge
Configure API Key
Set your OpenAI API Key in Site Properties (e.g., OpenAI_APIKey)
OpenAI_APIKey
Create a REST Integration
Endpoint: https://api.openai.com/v1/chat/completions
HTTP Method: POST
POST
Add Header: Authorization: Bearer <Your_API_Key>
Authorization: Bearer <Your_API_Key>
Add Header: Content-Type: application/json
Content-Type: application/json
Prepare the Request Body
Build a JSON payload like the example above
Parse the Response
Use JSON Deserialize to convert the response to OutSystems structures
JSON Deserialize