How to process each element of an array in a record

The ForEach step is useful when you want to view or manipulate each element in an array which is in a record. The ForEach step iterates over the record array to process each element in the array.

Illustrated in the below image is an example of a flow of how the ForEach step is used.

The Record Generator is used as a source step to populate data and an array is included in the record as shown in the image below.

image

The below image is the output of the data that is in the Record Generator.

image

The ForEach step is then added to process each element in the array. To add the array name in the ForEach step, click on the highlighted icon in the below image.

image

The below page will appear. The Array Path is the name of the array that is in the record. In this example, “tasks” is the array in the record.

image

Illustrated in the below image is the output in the ForEach sub-flow. It breaks up each element in the array to process it by becoming separate records.

image

The output outside of the ForEach sub-flow is the original record as shown in the below image.

image

Video of the ForEach step

How to pass a field from the main flow to a sub-flow or to a control step