Blocks & Flow EditorCommon

array loop

Iterate over array elements and execute connected blocks for each item

The array loop block iterates over an array, sending each element to the loop body until all items are processed. When the array ends, the flow exits from the end array output.

Bot Studio array loop block on canvas Array loop block Key and Array configuration Array loop reset on exit configuration Array loop output ports and wiring explanation

Configuration

FieldDescription
NameOptional display label. Defaults to the array expression if empty.
KeyVariable that stores the current array index. Must be a msg, flow, or global property. Auto-generated name if left blank (e.g. al{blockId}).
ArrayThe array to iterate. Set to a msg, flow, or global property containing the array (e.g. msg.rows). Cannot be msg.payload directly.
Set key variable to … when exitingReset the key variable when the loop ends. Choose null, undefined, or empty string. Useful when nesting multiple loops.

Outputs

PortLabelDescription
Upperend arrayFires when all elements have been processed — connect post-loop logic here
Lower(loop body)Fires for each element — connect blocks that run per item. msg.payload contains the current element

Notes

  • On first entry, the Key variable must be null, undefined, or empty string — otherwise the index is not reset to 0
  • Do not modify the key or array inside the loop in ways that prevent termination — this can cause an infinite loop
  • Wire the loop body back into the array-loop input to continue iteration
  • msg.payload on the lower output is the current array element
On this page

On this page