Target Format Schema
A Target Format is stored as TargetFormatSchema, which is composed of meta-information as well as fields, each with its own set of properties:| Name | Type | Properties | Description |
|---|---|---|---|
TargetFormatSchema | Interface | id: stringtargetFormat: TargetFormatname?: stringjobs?: JobSchema[]default?: boolean | How a target format is stored in the database, with associated jobs and meta-information. |
TargetFormat | Interface | [key: string]: TargetFormatField | Defines the structure of the target format, with keys as field names and values as TargetFormatField objects |
TargetFormatField | Interface | type: ‘string’ | ‘number’ | ‘boolean’ | ‘array’description?: stringchoices?: string[]attributes?: TargetFieldAttribute[]fields?: TargetFormat | Defines the structure of a field in the target format |
TargetFieldAttribute | Enum | requiredcapitalizedwholeNumberpositiveNumberdecimalNumberemailurlphoneNumberdatetimedatetimecurrencypercentageprimaryindexProductIDembedTextembedImage | Enum of possible attributes for a target field |
| Type | Description | Default Value |
|---|---|---|
string | Represents textual data. Can be any sequence of characters. | "" (empty string) |
number | Represents numeric data. Includes integers and floating-point numbers. | 0 |
boolean | Represents a logical value. Can be either true or false. | false |
array | Represents a list or collection of values. Can contain elements of any type. | [] (empty array) |
| Attribute | Compatible Types | Transformation Explanation |
|---|---|---|
capitalized | string, array | Transforms the first letter of each word to uppercase. E.g., “hello world” becomes “Hello World”. |
wholeNumber | number | Rounds down to the nearest integer. E.g., 3.7 becomes 3. |
positiveNumber | number | Ensures the number is greater than 0. |
decimalNumber | number | Ensures the value is parsed as a float with 2 decimal places. |
email | string, array | Validates the string as an email address and normalizes format (lowercase, trim whitespace). |
url | string, array | Validates and normalizes URL format, adds “https://” if missing. |
phoneNumber | string, array | Formats phone number to a standard format, e.g., (xxx) xxx-xxxx in the US. |
date | string, array | Parses various date formats into a standard date format: YYYY-MM-DD. |
time | string, array | Parses various time formats into a standard time format: HH:MM:SS. |
datetime | string, array | Combines date and time parsing, outputting a standard format: YYYY-MM-DDTHH:MM:SS. |
currency | string, array | Converts string to 3 letter currency code. E.g. dollar, usd $ => USD. |
percentage | string, array | Converts decimal to percentage or ensures correct format, e.g., 0.5 to 50% or 50 to 50%. Must be used with types string or array. |
| Attribute | Compatible Types | Transformation Explanation |
|---|---|---|
required | string, number, boolean, array | Ensures a non-null, non-empty value is provided. If no value is provided, the field will be skipped during indexing. |
primary | string, number, boolean, array | Defines the field as the primary index that is used to match during updates. This will be used to create the row id. You can define multiple fields as primary. During updates, if all of a new row’s primary fields are equal to an existing row, it will update the existing row. It is best practice to apply primary to the indexProductId and the product link fields to get the best results. |
indexProductID | string | Special flag that leverages the index product grouper. Fills the field with a unique and product id provided by index that is persistent across merchants and sources. |
embedText | string, array | Uses the specified field to create an embedding from the field content. At least one embedText or embedText is required if you want to use semantic search. |
embedImage | string, array | Uses the specified field to create an image embedding from the field content. Field content needs to be a URL that points to an image. At least one of the flags is required if you want to use semantic search. |

