Skip to main content
Core Actions

For Each

Reference documentation for using the For Each action

Written By Support Channel

Last updated Over 1 year ago

Overview of the For Each action

The For Each action allows you to run a set of actions repeatedly once for each item in an array. This action is ideal for scenarios where the same operation needs to be performed on multiple values.

Purpose

To repeat a set of actions for each item in an array, enabling workflows to handle multiple values dynamically without duplicating logic.

Parameters

Array - Current Array Item

Output

ForEach.CurrentArrayItem - Value of the item of the array. (This output is only available inside the For Each action loop.)

Understanding the For Each action

The For Each action is designed to automate repetitive tasks by iterating over items in an array or lists. Workflow actions within the For Each loop are applied to each item of the array, in turn.

During each loop, the current array item is available as an output of the For Each action.

Current Array Item

Array that the For Each action will use to loop through and execute

Working with For Each action

When working with the action, you'll first need to set an array of Items for the action to run against. Typically this would have been created earlier in the workflow using the Create Array action or returned from an API/Integration call. Once you have set a array list in the For Each action, the action loop will process each item in that array one by one.

Create and manage For Each actions

Add a For Each action

Add the action

Use the following steps to add the action to a workflow.

  1. Click the ‘plus’ symbol on the workflow path at the point you want to insert the action. This opens the action menu slide-over.

  2. Either:

    • Search for the action using the Search field above the actions in the menu.

    • Locate a Recently Used action in the top section of the menu.

    • Navigate to the action within menu: Core actions are listed under Actions, while Plugin actions are contained within their associated integration.

  3. Select the desired action to insert it. This reveals the action’s configuration panel.

  4. Use the Name field to name the action. This can help users to understand your workflow at a glance. (optional)

  5. Use the Description field to add information describing the action. This can help users wanting to understand how your workflow functions. (optional)

Configure the action

Use the following steps to configure the action.

  1. Set a value for the Current Array Item.

  2. Click back in the main view to hide the slide-over.

  3. Click the ‘plus’ symbol on the control path inside the For Each action. This will open the action slide-over.

  4. Select an action for the For Each action to run.

  5. Add further actions to the control path inside the For Each loop as needed.

Note

Inside the For Each loop, use the ForEach.CurrentArrayItem action output to access the current item of the array.

Delete a For Each action

Use the following steps to remove the action from your workflow:

  1. Access the workflow in draft mode to edit it.

  2. Either:

    • hover your mouse cursor over the action, and then click the red cross that appears over the top-right corner of the action to delete it. Or:

    • click on the action to open the action slide-over. Click the red 'Delete Step’ button to remove the action from your workflow.

  3. Click Publish in the top-right to commit your changes.

Take care when deleting an action to also remove any logic using its outputs: workflow steps may function incorrectly or break if they attempt to evaluate an output of a deleted action.

Was this helpful?

Still need help? Share an idea