MultiSource Processing Instructions in Generic JSON

To extract the values of a JSON array as a multi-value field that can be mapped to a multi-valued attribute / reference / set of data container values in STEP, place a "[?MultiSource [OptionalIdentifier]?]" instruction in place of the array for the attribute of the "[?Record?]" scope:

Copy
{
  "Products" : [
    {
      "[?Instruction?]": "[?Record?]",
      "ID" : "[?Source?]",
      "Keywords" : "[?MultiSource?]"
    }
  ]
}    

Within the same scope, multiple values in an array using a "[?MultiSource [OptionalIdentifier]?]" declaration contribute to the same multi-value field. The input document below uses the template above.

Copy
{
  "Products" : [
    {
      "ID" : "42",
      "Keywords" : [
"Red",
"Green",
"Blue"
]
    }
  ]
}   

It produces the fields 'ID' and 'Keywords' with values ID=42 and Keywords=Red;Green;Blue. Note that if a "[?Source?]" instruction is used for mapping to an array, only the first value in the array is extracted from the document. A document with the 'Keywords' array in the 'Products' array could be processed by using the following template to only extract the first value:

Copy
{
  "Products" : [
    {
      "[?Instruction?]": "[?Record?]",
      "ID" : "[?Source?]",
      "Keywords" : "[?Source First Keyword?]"
    }
  ]
}

Like the "[?Source?]" instruction, the "[?MultiSource?]" instruction also supports explicitly specifying a field name using an optional identifier as shown above with the "First Keyword" optional identified instead of "Keywords". For more information, refer to the Preventing Duplicate Field Names section of the Source Processing Instructions in Generic JSON documentation here.