For each loops are one of the two types of loops available in SecureX orchestration. This type of loop consumes an array of data and runs the content of the loop once for each item in the array. If you want to loop for an arbitrary number of times or while a condition is true, you should look at the
- You can stop a loop using the
- You can skip the rest of a single iteration of a loop using the
The source data for a
For Each Loop must be an array. These often come from activities like
Read Table from JSON/Text/XML or
Split String. To give a
For Each Loop its source, you simply pick the array variable:
For Each Loop, you’ll probably want to use the values in your table’s columns. You can do this by using the variable browser to:
- Select the loop.
- Select its
- Select the column you want.
Here’s a sample of the source array’s
name column being used as a variable:
The following sample workflows are available in our repository’s workflows folder to help you get familiar with this activity. These can be imported using the instructions here or you can view the workflow in GitHub by clicking on it.