Help Centre › Building Processes
Description
Overview of LOOP functions available in RPA. These functions allow you to repeat actions, iterate over data, and control loop execution flow.
Available LOOP Functions
- Break / exit a loop: Stops the current loop and exits.
- Each file in a folder: Iterates through each file in a specified folder.
- Each folder in a folder: Iterates through each subfolder in a folder.
- Each record from a JSON file: Iterates through records in a JSON file.
- Each item in a list: Iterates through each item in a comma or newline separated list.
- Each record in a list: Iterates through each record in a data list.
- Each record from an API: Iterates through records returned by an API.
- Each row from a website table: Iterates through rows of a table on a web page.
- Each row in an Excel sheet: Iterates through each row in an Excel sheet.
- Each sheet in an Excel file: Iterates through each sheet in an Excel workbook.
- Each unread email: Iterates through unread emails in Outlook.
- Next loop iteration: Skips to the next iteration of the current loop.
- Number of times: Repeats actions a specified number of times.
- While: Repeats actions while a condition is true.
Naming each iteration: the transaction key
Every loop has a Transaction key — a formula, evaluated per iteration, that names the item the loop is working on (for example {row[Reference]}). It is what the run diary, the reports and the error popup use to tell one iteration from another; leave it blank and every iteration reports the same key.
When the loop works items from a queue, set the transaction key to the item's reference: {item[reference]}. The error popup's Retry item button finds the failed queue item through that key — with any other key it can only offer Open queue, and a person has to find the item by hand. A future bot release will fall back to the item's reference automatically when the key is left blank; an explicit key is never overridden.