- 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
- Set Variable
statuses=paid,open,paid,cancelled,open,open. - Set Variable
openCount=0. - String Operation split, Input
{{statuses}}, Delimiter,, Save To VariablestatusList. - Loop, Loop Type collection, Collection Variable
statusList, Item Variablestatus. - Inside the loop, If Condition: Variable
status, Operator equals, Valueopen. - In Then: Math add,
openCount+1→openCount. - 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.