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.
To do so, follow these steps:
- Click the array for which you want to do the mapping in the input schema. The mapper opens to its right.
- Under Functions, click array to expand it.
- Click create(item). It appears in the text box above.
- Click item to replace it with the output element to use to create the array.
- 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.
Related concepts
Copyright © Cloud Software Group, Inc. All rights reserved.