Repeat For Each Item Widget

Repeat For Each Item Widget

icon-video2: Video example of this widget

The Repeat For Each Item widget executes a series of other widgets for each item in a list. The widget can run for all items in a list, or can be limited to a specific start and end item.

NOTE: For widgets dropped inside the Repeat For Each Item widget, Current Item refers to the item the workflow was started on. It does NOT refer to the item the Repeat For Each Item widget is currently on in the loop. To execute a widget against the current item in the loop, use a Field Lookup to the Repeat For Each Item widget Lookup Item ID variable.

sa08LimitationIcon.jpg Widget Limitations

  • When specifying Start Item or End Item conditions based on criteria in a SharePoint Person or Group column configured to allow multiple values, the SharePoint column values must be listed in the exact order specified in the widget. For example: If the widget is waiting for the Person or Group column to change to User1; User2, SharePoint column values entered as User2; User1 will not match.

  • When specifying specific Start Item or End Item conditions based on criteria in a SharePoint Choice column configured to allow multiple values, you cannot select the values in the widget like you can for single Choice columns. You must enter them as text or a lookup to text in the format Value1, Value2 (the space after the comma is required). The values must be entered in the same order they appear in the SharePoint column.

  • The widget processes one item per loop, with a minimum one-minute delay between items. This can result in a long-running workflow if Repeat for Each Item is processing a list containing many items. Use Start Item and End Item conditions to limit the number of items processed.

Widget Properties:

Column Description
Repeat Settings Click the Icon-Ellipsis button to select items for loop widgets to execute on. If you do not make any selections, the loop will start with the first item in the list and continue in order by SharePoint ID to the last item in the list.
Site Collection/Site/List To execute loop widgets on list items in the current site, select a list in the List box. To execute loop widgets on list items in another site or site collection, make the desired selections in the Site Collection and Site boxes, and then select a List and a View.
Start Item

Select the first item in the list to start executing loop widgets on.

NOTE: This condition is only used to identify a start item; it does not filter items in the list.

  • To start executing loop widgets on the first item in the list (by SharePoint ID), select First Item of List.
  • To start with a specific item in the list, select Conditional Item and specify the condition that must be met. The loop will start with the first item in the list (by SharePoint ID) that meets the condition and continue in order by SharePoint ID to the End Item.
End Item

Select the last item in the list to execute loop widgets on.

NOTE: This condition is only used to identify an end item; it does not filter items in the list.

  • To stop with the last item in the list (by SharePoint ID), select Last Item of List.
  • To stop with a specific item in the list, select Conditional Item and specify the condition that must be met.

The loop will execute for items in the list until the End Item condition is matched, and then exit. Widgets are not executed on the End Item.

Store Loop Item ID (Required) Select a workflow variable with a Number data type. The Loop Item ID variable stores the ID of the current item in the loop. You can use this ID with a Field Lookup to execute widgets on the current item in the loop not the Current Item (which refers to the item the workflow was started on). Create variables in the Workflow Settings tab in the settings pane, or click the Create new variable link next to the variable list.
Loop Delay (minutes)

Enter the delay between items processed by the widget, in minutes. Each loop processes a single item in the list. The minimum delay is one minute.

NOTE: Workflow processing is dependent on the Workflow timer job, which evaluates workflow status every 5 minutes. Repeat for Each Item conditions will be evaluated at the next timer job interval after the specified Loop Delay has elapsed. This means that the minimum effective Loop Delay settings is 5 minutes, even though you can specify a Loop Delay of as little as 1 minute.

Click Apply to save the widget settings.

Return to Workflow Logic Widgets List

See Also: