Before you begin
Workflows are very powerful tools, and a bad workflow configuration can bring down your entire system. For this reason, we recommend that you rely on our workflow library and limit workflow creation to users with the necessary technical skills.
Plans: Enterprise only
Audience: Administrators
Loops are activities that allow your workflow to go through a list of records and perform the same action for all of them. For example, you could use a loop to find the completion date for all the tasks in a work order.
To add a loop to a workflow:
- If you aren’t already editing a workflow:
- Go to Settings > Workflows.
- Click the workflow you want to configure the loop for.
- In the Activities tab, do one of the following:
- If you already have a loop activity but haven’t configured it yet, click it in the list of activities and skip to step 6.
Loop activities have a loop icon () in the Type column:
- To add a new activity, click the + button:
Tip: You can also configure loops as “sub-activities” within a condition activity. This means that the loop would only based on the result of the condition (i.e. the condition being either met or not met, depending on how you configure it). To learn more about setting up condition activities, see Add a condition activity to a workflow.
- If you already have a loop activity but haven’t configured it yet, click it in the list of activities and skip to step 6.
- Enter a name for the loop.
- In the I would like to section, select the Loop through a list of records and perform Common Activities against those records option:
- Click OK.
- In the Variable Name field, enter the name that you’ll use when referring to this loop in expressions (such as in if/else conditions).
- In the Iterable Expression field, enter the necessary code to specify which records you want the workflow to loop through:
- To configure the activities the loop will perform:
- In the Activities section, click the + button:
- Enter a name for the activity.
- Select the type of activity you want the workflow to perform. To learn what each activity does, see Workflow activities.
- Click OK.
- In the screen that appears, configure the options provided. These will differ based on which activity you selected in step c. To learn more about the options for each activity, see Workflow activities.
- Click OK.
- To add additional activities, repeat steps a-f.
- In the Activities section, click the + button:
- Click OK.