You are here:
JSON Schema Example
A JSON Schema defines the structure for the form fields related to autofill use cases
Required Editions
This sample JSON schema includes the properties that are required to make sure that the customer complaints form is complete and that the recommendations are accurate.
{
"$id": "https://example.com/person.schema.json",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"What product or service is this complaint about": {
"type": "string",
"enum": [
"ATM / debit card",
"Bank, Checking or Savings Account",
"Credit Card or Prepaid Card",
"Insurance",
"Investments",
"Merchant Services",
"Mobile / electronic banking",
"Money transfers, virtual currency, and money services",
"Mortgage / Home Finance",
"Personal Loan / other loans",
"Vehicle loan or lease",
"Other"
],
"description": "The type of product related to the customer's complaint."
},
"Complaint Type": {
"type": "string",
"enum": [
"Advising",
"Selling and Arranging",
"Information",
"Charges",
"Product Performance",
"General Admin/ Customer Service",
"Transaction Related",
"Digital or Technology",
"Marketing or Corporate Communications",
"Accessibility Issues",
"Financial Hardship or Collections",
"Lending / Credit",
"Others"
],
"description": "The type of the customer's complaint."
},
"Complaint Subtype": {
"type": "string",
"enum": [
"Unsuitable Advice",
"Unclear Guidance",
"Unclear Arrangement",
"Dispute Over Charges",
"Product Performance",
"Product Features",
"Product Disclosure Information",
"Instructions Not Followed",
"Service Request Delay",
"Other Customer Service",
"Other General Admin",
"Account Opening",
"Account Closure",
"Unauthorised Transaction(s)",
"Fraud Handling",
"Payment Related Issue",
"Auto Debit Mandate",
"Cash not Dispensed",
"Online Banking - Features or Functionality",
"Mobile Banking - Features or Functionality",
"Misleading Advertising",
"Inaccessible ATMs",
"Inaccessible Branch Entrances",
"Inaccessible Website",
"Inaccessible Mobile banking features",
"Unacknowledged Debt Collection Attempt",
"Communication Tactics",
"Missing Debt Notification",
"Credit Limit Changed",
"Credit Report",
"Credit Score",
"Others"
],
"description": "The subtype of the customer's complaint."
},
"Subject": {
"type": "string",
"description": "The subject of the customer's complaint."
},
"Description": {
"type": "string",
"description": "The description of the customer's complaint."
}
},
"required": [
"What product or service is this complaint about",
"Complaint Type",
"Complaint Subtype",
"Subject",
"Description"
]
}
The above schema includes these properties.
- Product or Service: A string with predefined options for different products or services.
- Complaint Type: A string with predefined options for the type of complaint.
- Complaint Subtype: A string with predefined options for the subtype of the complaint.
- Subject: A string for the subject of the complaint.
- Description: A string for the detailed description of the complaint.
Considerations for Defining the JSON Schema
When you create and validate JSON schema for form fields, remember these factors.
- Use third-party tools to create and validate your JSON schema.
- List all the form fields that you want to generate recommendations for by using the Einstein Autofill feature in the properties array.
- Include a type, a description, and, if applicable, enum values for the picklist or multi-select fields for each property.
- Make sure that each property type matches a valid JSON data type.
- More detailed descriptions improve the quality of the autofill recommendations.
- Match the property name exactly with the field name in the Omniscript for successful form integration.
- Set the JSON property type to a string with the enum values of 'true' and 'false' if your Omniscript element is a checkbox.
- Define regular expressions for string properties by using the pattern keyword to match the entered data with a specific format, such as email addresses or phone numbers.
- Specify the type as an array and define the item's type and any additional constraints if a property is an array.
Did this article solve your issue?
Let us know so we can improve!

