Flow Control

ForEach

ForEach loop is a statement for specifying iteration, which allows code to be executed repeatedly for all elements (items) of the selected data aggregate - e.g. Array or List.

In a header section are declared elements (items) and data aggregate. In a body section should be specified activity that will be executed for each item.

Before proceeding to the next iteration, the loop assigns value of the next data aggregate's element to the control variable. The name of the control variable can be changed in the Properties window (default is item).

You have to specify the type of data stored in the given data aggregate. Default is Object, but it can be changed to e.g. Int32 or String.

for-each_001
for-each_002
Parameter nameParameter TypeIn/OutDescription
DisplayNameLiteralInputyou can change the name of activity for greater clarity of the scenario
TypeArgumentDropdownInputthe data type of element (item); select the appropriate option from the dropdown list
ValuesContext basedInputvariable (type: collection type or Object), refers to the collection over which the statement is to be repeated