Mapping Identical Arrays of Objects

When mapping an array of objects in the input to an identical array of objects (matching property names and data types) in the Upstream Output, keep the following in mind:

  • map the array at the root level. The array.forEach() function automatically gets inserted with the array scope and a scoping variable for the scope as its arguments. You need not map the array object properties individually if you want all properties to be mapped and if the object property names are identical. The properties get automatically mapped.
  • if you do not want all the properties within the object to be mapped or if the names of object properties do not match, you must map the object properties individually too after mapping the root. If you do not do the child mapping individually, the mismatched properties in the objects remain unmapped if the properties are not marked as required (marked with a red asterisk). If such a property is marked as required, then you see a warning.
  • the size of the input array is determined by the size of the array in the Upstream Output to which you are mapping.

To map identical arrays of objects, follow these steps:

Procedure

  1. Click on the input array root (objArray1 in the example image below).
  2. Click the array you want to map to in Upstream Output (objArray in the image below). The array.forEach function appears in the text box. If the names of all the child elements match, the child elements get mapped automatically. You need not match each child element individually. In this example, none of the child names match, so you would need to do the individual mapping otherwise none of the elements get mapped.

    Shown below is the syntax of array.forEach in the image above :

    The "objArray1" in red font is the scoping variable which constitutes the scope of the current input array. Basically, this means that you can map any element in objArray1 with an element of same data type in flow.objArray in the Upstream Output. So, you are defining the scope of objArray1 to be all the elements within objArray.