Skip to content
Last updated

Repeats a set of nodes a specified number of times or iterates over each item in an array. Use this to process lists, retry operations, or perform repetitive tasks.

Parameters

  • Loop Type
    • Number Loop: Repeat the enclosed nodes a fixed number of times.
      • Loop Count: The number of iterations. Enter a number or reference a variable.
    • Array Loop: Iterate over each element in an array.
      • Array: Reference an array variable (e.g., the element list output from Find Element).

Output

  • Output Parameters
    • Current Index: The current iteration index (0-based)
    • Current Item (Array Loop only): The current element in the array
  • Execution Log
    • Start Time
    • End Time
    • Duration (ms)
    • Status (Success/Failure)

Example

1. Number Loop — Swipe through 5 pages

Swipe the screen 5 times to browse through content:

Field NameField Value
Loop TypeNumber Loop
Loop Count5

Inside the loop, add a Swipe Page node followed by a Wait node (e.g., 2000ms) to pause between swipes.

2. Array Loop — Process a list of found elements

Use Find Element with "Get element list" to get all matching elements, then loop through each one to extract its text:

Step 1: Find all app icons

Field NameField Value
When Condition is MetfullId Equals com.android.launcher3:id/icon
When there are multiple matching objects on the pageGet element list

Step 2: Loop through the element list

Field NameField Value
Loop TypeArray Loop
Array{{Find Element.Element list}}

Step 3: Inside the loop — Tap, Wait, and Return

Field NameField Value
Tap ElementUse Previous Element{{Loop.Current Item}}
Wait3000ms (Wait for the app to load)
Press KeyBack

loop

This will iterate through all the apps on your desktop and then exit them.

Tips

  • Avoid infinite loops: Always ensure your loop has a defined exit condition. Number Loop naturally stops; Array Loop stops when all items are processed.
  • Add delays between iterations: Insert a Wait node inside the loop to prevent actions from executing too rapidly.
  • Use Current Index for conditional logic: Combine with Switch to execute different actions on specific iterations (e.g., skip the first item, or stop after the 10th).
  • Nested loops: You can place a Loop node inside another Loop node for multi-level iteration (e.g., loop through pages, then loop through elements on each page).
  • Find Element — often provides the array for Array Loop
  • Switch — add conditional branching inside loops
  • Wait — add delays between iterations
  • Run JS Script — process individual items inside the loop