Skip to main content

Loop through list

Sophie avatar
Written by Sophie
Updated over 3 weeks ago

Definition and Usage

Loop through each item in a list. This command allows you to iterate through all elements in a specified list, processing each item one by one. You can access both the current item and its position (index) during the loop operation.


Parameter Values

Input parameters

Parameter

Description

Possible Values

Required

Options / Notes

Select a list

Select a list of variables or numbers to iterate

Any valid list variable

Yes

Can use variables containing arrays or lists

Store loop index in variable

When selected, this will automatically output the position of the current item in the list, starting from 0

True/False

No

Checkbox option

Variables produced

  • Save loop item as: Store the loop item in a new variable

  • Save loop index as: Position of the current item in the list, starting from 0


Using Variables in Conditions

You can use variables in this command by clicking the {x} icon next to input fields. This allows you to:

  • Reference existing list variables to iterate through

  • Use dynamically created lists from previous commands

  • Store the current loop item and index in variables for use in nested commands


Notes

  • The loop index always starts at 0 for the first element, following standard programming conventions

  • You can nest loop commands to process multi-dimensional arrays or perform complex iterations

  • Empty lists will not execute the loop body at all

  • This command creates a block structure that requires nested commands to be placed inside to be executed for each iteration

  • Make sure the list variable exists and contains valid data before using this command

Did this answer your question?