For Each Wizard

This content applies to legacy design tools (such as K2 Studio, K2 for Visual Studio, or the Silverlight-based K2 workflow design tool). If you have upgraded from K2 blackpearl 4.7 to K2 Five, these tools may still be available in your environment. These legacy tools may not be available in new installations of K2 Five. These legacy tools may also not be available, supported, or behave as described, in future updates or versions of K2. Please see the legacy component support policy for more information about support for these components.

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.