Using Loops to Control a Bot

Citizen Developer Journey

Learning Experiences

Using Loops to Control a Bot

Using loops in Automation Anywhere Enterprise A2019 allows for developers to control how many times, and under what conditions, actions are run in a repetitive basis. Mastering loops means having full control over your bots actions, and making sure that the bot can dynamically handle a single operation, or multiple operations in a single bot run.

Loops are one of the most powerful constructs in bot building. Loops are instructions that repeat containing actions for a specific number of times or until a specified condition has been satisfied. In a loop, the loop checks for completed number of specified iterations or the satisfaction of a condition – if that condition is not yet satisfied or the number of iterations is not yet satisfied, then the operations within the loop are executed. The same conditions are checked for again and again until the condition(s) has been satisfied, at which point the logic inside the loop is no longer executed. Each time the condition is checked for satisfaction is called an iteration of the loop.

To Do


Loops can be very powerful when used correctly in bot builds especially when actions need to be taken a variable number of times. If you find yourself automating a process that “sometimes needs to run once, but sometimes needs to run multiple times based on “you’ll know that its going to be a good opportunity to build the bot in a dynamic way in order to handle such variability using loops.