Repeat While Widget
The Repeat While widget executes a series of other widgets while up to two defined conditions are True. The condition is checked at the start of each loop. When the condition is no longer True, the workflow exits the Repeat While widget and continues with the next widget in the workflow. If more than two conditions are required, Repeat While widgets can be nested.
NOTE: Dropping widgets inside the Repeat While widget is optional. The widget can also be used to simply pause a workflow until a condition is met.
Widget Limitations:When entering a condition to match values in SharePoint Person or Group or Choice columns configured to allow multiple values, enter the matching value in the format listed below:
- Person or Group columns: User1;User2
NOTE: There is no space after the semicolon for the match condition, even though SharePoint displays one in the actual column value.
-
Choice columns: Value1, Value2
NOTE: The space after the comma is required.
The values must be listed in the same order as they appear in the SharePoint column. For example: If the condition is listed as User1;User2 or Value1, Value2, SharePoint column values entered as User2; User1 or Value2, Value1 will not match.
Widget Properties:
Column |
Description |
Condition (Required) |
Click the button to open the Condition Builder form:
- Condition: Choose from a set of pre-defined conditions or compare two data sources using a set of logical operators:
- Current item was created between these dates: Checks whether an item was created within a date range. Specify start and end dates or define dates using lookups.
- Current item was modified between these dates: Checks whether an item was last modified within a date range. Specify start and end dates or define dates using lookups.
- Current item was created by this user: Checks whether an item was created by a specific user. Type a user account and click the Check User icon (), click the Lookup User icon () to search for a user in the User Lookup form, or enter a lookup to a user using the Add Lookup button () in the User Lookup form.
- Current item was modified by this user: Checks whether an item was last modified by a specific user. Type a user account and click the Check User icon, click the Lookup User icon to search for a user, or enter a lookup to a user using the Add Lookup button in the Lookup User form.
- Current item has these keywords in the title: Checks whether the Title of the current item contains a particular text string (case insensitive). Enter a specific string or define one using a lookup.
- Compare these data sources: Compares two values using a logical operator. Enter values explicitly or, more commonly, define them using lookups. The following logical operators are available:
- Equals
- Does Not Equal
- Contains
- Does Not Contain
- Is Empty
- Is Not Empty
- Starts With
- Does Not Start With
- Ends With
- Does Not End With
- Greater Than
- Less Than
- Add Another Condition: Click this link to add another condition to the Condition Builder. Conditions can be joined using AND or OR. Once a second condition is added, remove it by clicking the Remove Condition link.
|
Loop Delay (minutes) |
Enter a delay between the completion of the last widget inside the Repeat While widget and the next condition evaluation. This delay reduces the chance that an unintentional infinite loop can use too many server resources. If no Loop Delay is specified, a default delay of 60 minutes is used. For longer delays or a delay until a specific time, consider using a Delay For or Delay Until widget inside the Repeat While widget.
NOTE: Workflow processing is dependent on the Workflow timer job, which evaluates workflow status every 5 minutes. Repeat While 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. |
Example of Repeat While Widget
Return to Workflow Logic Widgets List
See Also: