For Loop
Overview
The For Loop in autobotAI allows you to automate repetitive actions on multiple items. It is designed to handle both static lists (manually entered values) and dynamic lists (fetched from previous nodes or API responses).
By using the For Loop, you can iterate over data sets and execute tasks for each item—saving time and reducing manual effort.
This guide explains how to configure the For Loop with static and dynamic list values in your autobotAI.
Prerequisites
Before setting up a For Loop, make sure:
- You have an existing bot workflow or are creating a new one.
- A node exists if you plan to use dynamic lists.
Steps to Add and Configure a For Loop
Step 1: Add the For Loop Block
- Open your bot in the autobotAI Builder.
- Click the + button where you want to insert the loop.
- Select Loop Start from the block library.
Step 2: Configure Loop Type
In the Loop Start settings panel:
- Set Loop Type to
List
. - Choose between:
- Static for manually entered items.
- Dynamic for data from previous nodes.
Step 3: Enter List Items
Static List
Provide a JSON array of values to iterate over.
Example:
json["item1", "item2", "item3"]
This will loop three times—once for each item.
Dynamic List
Reference previous node results using variables.
Example:
Use $$
to browse and select value from previous nodes.
json{{$.nodes.start[*]}}
Step 4: Complete the Loop
- Add any actions inside the loop.
- Click the Loop End and save it as it automatically select previous node results.
Example Videos
Watch how to set up both static and dynamic lists in a For Loop:
- 🎥 Static List Example
- 🎥 Dynamic List Example