Skip to main content

List Loop

Command description

Iterates through a list and exposes the current item and zero-based index to the indented child commands.

Command Input Parameters

input parametersInput parameter typeDescription
List Objectlist[any]List to iterate, such as a similar-element list or webpage list; may also be a Python list literal
Reverse IterationboolWhether to iterate from the last item to the first; defaults to False

Command Output Parameters

Output parametersOutput parameter typeDescription
Current ItemanyCurrent list item
Current IndexintZero-based index of the current item

Example 1

Get the titles of all currently opened web pages

Example 2

Loop over Python list literals. List Object in workflow JSON is a Python expression stored as a JSON string. Runavelo inserts that expression into the generated Python source.

[
{
"children": [],
"in": {
"List Object": "[1,2,3]",
"Reverse Iteration": "False"
},
"out": {
"Current Item": "listItem",
"Current Index": "listIndex"
},
"ins": "List Loop"
}
]