Source Processing Instructions in Generic JSON

To extract the value of a name-value pair as a field, place a "[?Source [OptionalIdentifier]?]" processing instruction within the "[?Record?]" scope of the template in place of a value. By default, the heading (column) name of a field is the JSON name of the name-value pair.

Copy
{
  "Products": [
    {
  "[?Instruction?]": "[?Record?]",
  "ID": "[?Source?]",
  "Name": "[?Source?]",
  "Description": "[?Source?]"

}
  ]
}

In the above example, each record encountered in the "Products" array is transformed into a row with data for the columns ID, Name, and Description in the Import Manager wizard.

To make the mapping step easier using the Auto Map button, use your own identifiers that match STEP attribute IDs by defining an optional identifier. As shown in the "Text" name-value pair in the example below, the Text field will display with a heading of 'Description' since the optional identifier was used within the "[?Source?]" processing instructions. The optional identifier displays in the Map Data step.

Copy
{
  "Products": [
    {
  "[?Instruction?]": "[?Record?]",
  "ID": "[?Source?]",
  "Name": "[?Source?]",
  "Text": "[?Source Description?]"

}
  ]

Preventing Duplicate Field Names

Fields extracted using the "[?Source?]" and "[?MultiSource?]" instructions can sometimes have the same names, either because of identical JSON names or because of duplication of names explicitly chosen by the template creator. In this situation, the Import Manager ensures that all field names are unique by adding a post-fix of the form (n), where n is the first integer >= 2 for which the combined field name is not already in use.

If a repeated scope contains multiple "[?Source?]" and "[?MultiSource?]" instructions, and one of them results in a name duplication, only that field will be renamed.

Note: Resolve name collisions by providing explicit, non-duplicating names.