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 do not need to 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
Available data,
$flow
points to
numArray, which is the scope for
numArray in the input.
Creating Arrays When Data Types Do Not Match
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
Available data, you can create an array using the
array.create(item)
function.
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:
- Click the array for which you want to do the mapping in the input schema. The mapper opens to its right.
- Click Functions and click array to expand it.
- Click
create(item)
. It is displayed in the text editor. -
Replace
item
with the output element to create the array.In the following image, to map strArray, create an array since there is no array of strings under Available data. The
array.create()
function accepts any of the following: a hardcoded string, an element from Available data, an expression, or a function as shown below as long as they all evaluate to the appropriate data type.
Iterating Over Arrays
To iterate over an array and map values in a loop, you can use $loop.index
.
Here is an example of mapping values using array index: