Docs → RPA → Conditions, loops & data
Conditions, loops & data
What turns a straight list of clicks into something that reacts: branching on what the page shows, repeating over a list, and reshaping values along the way.
Conditions (if / whileLoop)
| Condition | Parameters | Matches when… |
|---|---|---|
| elementExists | selector | An element matching the selector is present. |
| elementNotExists | selector | No element matches the selector. |
| variableExists | variable | The variable has a non-empty value. An extraction that found nothing saves "", which counts as not existing — that's the main thing this is for. |
| variableNotExists | variable | The variable is unset or empty. |
| variableEquals / variableNotEquals | variable, value | Exact text match (or its inverse). |
| variableContains / variableNotContains | variable, value | Substring match (or its inverse). |
| variableGreaterThan / variableGreaterOrEqual / variableLessThan / variableLessOrEqual | variable, value | Numeric comparison — both sides parsed as numbers, so "50" correctly ranks above "9". A non-numeric value makes the condition false rather than falling back to a text compare. |
| variableOneOf / variableNotOneOf | variable, value | The variable exactly matches one entry in a comma-separated set (or doesn't). |
Data Processing
Pure variable transforms — no page interaction. Useful for reshaping whatever you extracted before branching on it.
| Command | Parameters | What it does |
|---|---|---|
| extractRegex Extract from Txt | variable, pattern, saveTo | Pulls the first regex match out of a variable. With a capture group, saves group 1; otherwise the whole match. No match saves an empty string rather than failing — branch on it with a variableExists condition. |
| toJson Convert to JSON | variable, saveTo | Validates a variable as JSON and re-saves it normalized. Required before extractField / randomExtract, which both refuse non-JSON input with a message saying so. |
| extractField Extract Field | variable, path, saveTo | Reads a key or array index out of a JSON variable. Supports dotted paths — user.name, items.0.id — so a nested value doesn't need a chain of steps. An object/array result is re-serialized as JSON so you can keep digging. |
| randomExtract Random Extraction | variable, saveTo | Like extractField, but picks a random entry instead of a named one. |