The For block

For block

The For block is a control Flow block used to repeatedly run a series of blocks in your Flow. It accepts an array as input. Then the For block sends each item in the array from its output port, one item at a time. You can use a Collect block to gather the individual items sent from the For block and place them back into their original array order.

Inputs

List - Accepts an array of values like [1,2,3] or ["one","two","three"]. The For block requires an array to be sent this input in order to execute.

Start - This input port executes the block when it receives input. If no block is connected to this input port, the For block executes when the Flow runs. For example, you could connect a Send Request block's Success output port here to synchronize the For block with the request's successful response.

Output

Item - Sends each item in the list sequentially, one at a time.

Setup

To set up the For block, connect the List input port to another block's output port that sends an array. Blocks that can send an array include the following:

  • A List block
  • A Get Variable block with a variable that has an array
  • An Evaluate block with an embedded List block
  • A Select block that selects an array

Optionally, you can connect the Start input port to another block's output port to trigger the For block's execution.

Example

To see the For block in an example Flow, check out Flow Snippets: For.

Last modified: 2024/08/23