Mapping an Array of Primitive Data Types

To map arrays of the same primitive data type, you only need to map the array root. You need not map the array elements.

Here is an example of mapping arrays of primitive data types:

The array names need not match, but their data types must match. In Upstream Output, $flow points to numArray in Upstream Output which is the scope for numArray in the input.

When you do not have a matching data type array in your output

If you want to map an array of primitive data types, but you do not have an array of the same data type in your Upstream Output, you can create an array using the array.create(item) function.
Note: array.create(item) can only be used to create an array of primitive data types. You cannot use it to create an array of objects.

To do so, follow these steps:

  1. Click the array for which you want to do the mapping in the input schema. The mapper opens to its right.
  2. Under Functions, click array to expand it.
  3. Click create(item). It appears in the text box above.
  4. Click item to replace it with the output element to use to create the array.
  5. Click the element in the Upstream Output with which you want to replace item. In the following image, to map strArray, you would need to create an array since there is no array of strings under Upstream Output. So, you map strArray by creating an array. The array.create() function accepts any of the following: a hardcoded string, an element from Upstream Output, an expression, or a function as shown below as long as they all evaluate to the appropriate data type.