Mapping an Element from a Parent Array to a Child Element in a Nested Array within the Parent

When mapping a primitive data type child element of the parent array to a child element of its nested array, the scope in the mapping is implicitly set to the scope of the parent array. In addition, you must provide the index of the nested array element whose variable you want to map to.

To do so, follow these steps:

Procedure

  1. Map the parent array root.
  2. Map the nested array root.
  3. Map the parent array element.

    In the example below, $loop is implicitly set to the scope of Customer which is MyCustomer. Notice that you must provide the index of the object in the MyAddress array whose MyCountry element you want to map to.