Processing Lists of Items using ForEach Step
  • 03 Jun 2022
  • 1 Minute to read
  • Dark
  This documentation version is deprecated, please click here for the latest version.

Processing Lists of Items using ForEach Step

  • Dark


The For Each Step passes individual items from a collection to a flow loop. The flow loop will then perform the same actions on each item. When every item has been processed, the loop forwards the finished collection to any subsequent steps outside of the loop.


This example will get a list of all accounts, for each account, the flow will show a pop up displaying the account email and order number. Below is a downloadable example to import into Decisions.

Begin by navigating to a Designer Folder and select the Create Flow button.


Name the Flow and select 'CREATE' to open the Flow in the Flow Designer.


Begin building the new flow by first adding a GetAll step from the Steps panel under Integration > Internal Services > AccountService.


Next from the Flow Management category In the Steps panel, drag a ForEach step to the workspace. This will be used to process the list of accounts.

The ForEach step needs to know the data type of items it will process, it's important to note that the ForEach step can take in any data type. Select the ForEach step and in the Properties panel, under Data, select the appropriate Type, for this example the Type will be Account.

Under Inputs > Collection select the output from the GetAll step. The ForEach step will output Item and Item Index. Item is the single element of the array being iterated through. Item Index is the order number of that element starting at 0.


On the Next outcome path of the ForEach step add a Show Pop-up step from the Favorite Steps category in the Steps panel.

Under Inputs select Item.EmailAddress for the Subject. For Message select Item Index.Default. Direct the flow back to the ForEach step so that it can continue processing the rest of the collection.


This completes the Flow; save it and run it in the Debugger.

This is just one example of how the ForEach step can be used. Keep in mind the ForEach step can iterate through both default system data types and user-defined data types to perform any action in a ForEach loop.


The Flow runs in the debugger and shows a pop up for each account. Each pop-up displays the email address and the order number of that account.


Was this article helpful?