ForEach

The ForEach block is a loop structure that you can use to repeat a set of actions for each element in an array. Each set of actions is known as an iteration. The ForEach block does not conduct any actions by itself. Specify which actions you want to be repeated by placing blocks between the ForEach block and the End For line.

Procedure

The ForEach block works well with the Assign block. To integrate ForEach block into your workflow, complete the following steps:

  1. Drag and drop the ForEach block onto your chosen location in the workflow.
  2. Enter information in the List field.
    Note: The list field must contain an array, initialized with this format [*], where * represents the items you want to iterate over. Separate the array elements by using commas, for example, [1,2,3,4,5,6,7,8,9,10].

    Iterations begin with the first element from the list (index=0), progressing sequentially until the last element of the list (index=(n-1)), where n signifies the total count of elements.

  3. Configure the Assign block according to the actions that you want to run. For example, in the Assign block's variable field you enter $result, in the value field type $ForEach_1.item.
  4. Run the workflow to apply the changes.

    The resulting structure sequentially runs iterations for every item within the array. The iteration count corresponds to the number of items that you provide in the array.

Disabling ForEach block

To temporarily disable ForEach block without deletion, turn off the switch in the block header.