Add a Loop

You can loop through the items within a list in a data object using the Loop node in your workflow.

You can either map individual fields (supported within Quick Apps) or use object-level mapping to return all data for the instance found without the need to map all the individual return fields. Then, create a task for each item found and not found.

When you add a Loop node, the following elements are added along with it:

  • Index and row found variables are auto-created and mapped.

  • Decision for the row found is added with true path and false path.

  • True path is linked to the task when an item is found and then looped back to the Loop node.

  • False path is linked to the task when there are no more items.

  1. On the Type list, select Loop. (Default:Task)
  2. By default, the Title is displayed as activity type. You can change the title as needed.
  3. On the Data object list, select a data object variable from an existing list.

    Alternatively, create a new variable if the required variable is not available by clicking and in the New dialog box, create the variable as needed. When creating the variables, include "Loop" in the variable names for easier identification of the variable during mapping. For example, LoopIndex and LoopRowFound. See Create variables for more information.

  4. To specify whether to return data only for the mapped fields or all data for the instance found, select either option for Return:
    • Field(s) (default): The list of fields from the selected data object is displayed in the table. Map the fields to the corresponding variables to return the data for the mapped fields.

    • Object: Map the data object variable to return all data for the instance found.

    If the required variable is not available, you can create a new variable using .

  5. Specify the task to perform when an item is found, in the Item found go to perform the following steps:
    1. On the Type list, select Task.
    2. In the Name field, a default name for the activity appears. You can modify the name as needed.
    3. Optional. Enter a Description for the node, such as "When cost is > 500".
  6. Specify the task to perform when no more items are found, in the Go to when no more items found perform the following steps:
    1. On the Type list, select Task.
    2. In the Name field, a default name for the activity appears. You can modify the name as needed.
    3. Optional. Enter a Description for the node, such as "When cost is < 500".
  7. Click Add.

    When you remove a Loop node, the system removes any unused variables within the node.