For Each Wizard
This wizard is found on the General Events node.
What does it do?
The For Each wizard creates dynamic reference and index fields to loop through items from an item collection.
How is it used?
The For Each wizard can be used in any scenario where an item collection must be converted into a list of items where something must be to done to each item in the list. This wizard is typically used in conjunction with the Create Reference wizard. The source list can be one of the following:
- An Item Reference created in the workflow
- An item collection from the Context Browser, such as a SmartObject List method
- A semicolon-delimited text
- It is important to note that a loop back must be manually created from the last outcome in the Next Item outcome path to the For Each event to ensure that the loop is closed. If the loop back to the For Each event is not created, the loop function itself does not occur. See the How to use the For Each wizard section for more detail.
- Wizards can be edited. For more information see Edit Wizards.
Prerequisites
If an Item Reference or item collection is used as the source list of items , this must exist before dragging the For Each wizard onto the canvas.

Provide the Source, Reference and Index for use in the creation of the list.

The For Each wizard automatically creates two outcomes as part of the workflow. These outcomes are used to determine whether the loop should continue or not.
Outcome rules are created for each outcome. As long as the outcome rule for the Next Item resolves to true, the loop continues.

It is important to take note of the steps to follow when using the For Each wizard as failing to do so might result in unexpected behavior. The next steps can be followed as a guide to complete the workflow steps necessary to use the For Each wizard:
- Create a source list to loop through
- Drag the For Each wizard onto the canvas
- Configure the wizard
- Add more workflow steps to the Next Item outcome if required. One example is to send an email using the email address of the Item Reference created. Multiple workflow steps can be added to this outcome if required
- Manually create a loop back from the last outcome in the Next Item path to the For Each wizard step by linking the outcome to the For Each as shown below. As a result, for every item in the collection, it will send an email to all email addresses within the collection until no items remain in the list. The workflow then continues to the No More Items outcome.
- Continue configuring the workflow as required

- The Create Reference wizard can be used with the For Each wizard as outputs from the Create Reference wizard are displayed as a flat list which is converted to a list of items within the For Each wizard.
- A loop back should be created from the last outcome in the Next Item outcome path to the For Each wizard to ensure that the loop is closed.
- If the loop back to the For Each wizard is not created, the loop function does not occur.