Station AcademyActivity referenceRPAi StationConsultingAurora Academy
Academy/Station Academy/Level 3/Combining conditions and loops
Level 3 · Automation fundamentals

Combining conditions and loops

A practical example that walks through a list, decides what to do with each item and keeps a count, step by step.

Intermediate≈ 20 min (estimate)Windows, macOSWorkflow engine-tested
Before this lesson
Loops
You will learn to
  • Build a loop with an If inside
  • Count matches
  • Report a summary at the end
Sample files
conditions-and-loops.station.json

The task

You have a list of order statuses, paid,open,paid,cancelled,open,open, and want to know how many are open.

Build it

  1. Set Variable statuses = paid,open,paid,cancelled,open,open.
  2. Set Variable openCount = 0.
  3. String Operation split, Input {{statuses}}, Delimiter ,, Save To Variable statusList.
  4. Loop, Loop Type collection, Collection Variable statusList, Item Variable status.
  5. Inside the loop, If Condition: Variable status, Operator equals, Value open.
  6. In Then: Math add, openCount + 1 → openCount.
  7. After the loop: Log {{openCount}} orders are open.
Set statuses
Set openCount = 0
Split → statusList
For each status in statusList
   If status equals open
      Then: openCount = openCount + 1
Log "{{openCount}} orders are open."

Read it aloud

If you can read your workflow aloud as sentences, it is well structured: For each status, if it is open, add one to the count. Then report the count.

Activities in this lesson

Loop · If Condition · Math · String Operation · Log

Saved only in this browser.

Workflow engine-tested. The sample workflow was executed with the macOS Station engine (StationCore) without the user interface. UI steps are source-verified. Written against RPAi Station for macOS 0.1.0 (1) (RPAi_Station_2.0 @ port/macos 9864e96) and the Windows source (RPAi_Station_2.0 @ codex/native-station e68f16d). Reviewed 2026-11-30. UI labels may differ slightly in other versions; see versions and changes.