Instruction Definition in Generic JSON

Generic JSON uses a similar character pattern to identify information to transfer as is used in Generic XML, with starting characters of “[?” and ending characters of “?]”, like this: "[?Instruction?]".

The template must be valid JSON; therefore the processing instruction values “[?Record?]” and “[?Repeated?]” must be identified with a name. A template can contain multiple instructions, but there must be exactly one “[?Record?]” processing instruction.

In the example below:

  • The “[?Record?]” instruction is used to identify each item in the "Items" array.

  • There are two “[?Repeated?]” instructions defined in: “Variants” and “Manuals”.

  • The “[?Source?]”, “[?SourceID?]”, and “[?DimensionPointID?]” processing instructions identify values and use the Name from the JSON document.

    The JSON Name can be overridden by a different name within the processing instruction when the optional identifier is used. In this example, “[?Source Description, Short?]” overrides “ConsumerShortDescription” with “Description, Short” when viewed in the Format and Mapping screens of the Import Data wizard.

    Ideally, optional identifiers are defined to match the ID of the attribute in STEP to facilitate mapping using the Auto Map button in the Import Manager.

  • STEP extracts data for each “Items” object inside the array, regardless of the number that exists. "Items" is the record object of the template. The record must not be declared as a repeated element.

Copy
{
    "Items": [
  {
        "[?Instruction?]": "[?Record?]",
        "EAN": "[?Source?]",
        "PrimarySpecs": {
          "ProductInformation": {
            "General": {
              "ProductName": "[?Source?]",
              "ConsumerShortDescription": "[?Source Description, Short?]",
              "AvailableFrom": "[?Source?]"
            }
  },
            "Variants": [
              {
                "[?Instruction?]": "[?Repeated?]",
                "Name": "[?SourceID?]",
                "Value": "[?Source?]"
              }
            ],
            "Manuals": [
                {
                "[?Instruction?]": "[?Repeated?]",
                "type": "[?DimensionPointID?]",
                "value": "[?Source?]"
                }
]
        },
        "SyncProtocols": "[?MultiSource?]"
      }
    ]  
}