For
Last updated
Was this helpful?
Last updated
Was this helpful?
A for
flow allows a block of code to be executed once for each item in an array. You can change the order of iteration by using array transformers such as .sorted()
or .reversed()
on the source data. Additionally, nested loops are fully supported.
Basic syntax of for
flow is as follows:
With the following required attributes:
property-name
- the newly created property where iterated data is stored
statement
- statement to be evaluated to retrieve data for the iterator. Array is expected
For example, a for
flow be used to create lists, menus, and similar structures from sourced data. Let's assume we have a variable users
defined that contains following data:
You can iterate on user data by defining a new variable user
where each item in the array gets stored in each iteration:
With each iteration, data in user
is different, resulting in the following output: