Skip to content

Loop

Loop allows you to repeat the execution of a collection of actions within inner block and also loops through List and Dictionary variables.

Actions

For

This is the same as the for keyword in common programming languages, and settings are as follows:

  • Iterator: The options for iteration are:
    • Range: Run the same set of actions over and over again by Iterate times.
    • List: Iterates over the specified List variable.
    • Dictionary: Iterates over the specified Dictionary variable.

Break

The effect is the same as the break keyword in common programming languages.

Continue

The effect is the same as the continue keyword in common programming languages.

Example

1. Create List variable

Create a List variable of subtype String named productList and set four initial values: UiPath, AA, Zapier, YooginX.

Create Variable List of Strings

2. Iterate over the newly created List variables

  1. Drag and drop action Loop > For to the task node list.
  2. Select List from the Iterator drop-down box, and then select the variable productList you just created.
  3. Select option All items in the list.
  4. Finally, create an output variable currentProduct of type String to store each data item in the List.

Configure For Action

3. Display the contents of each traversal

  1. Add action String > Uppercase to convert each item to uppercase.
  2. Finally, take action Message Box to display the converted result.

String Uppercase Show Uppercase String