DocsRPA → 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)

ConditionParametersMatches when…
elementExistsselectorAn element matching the selector is present.
elementNotExistsselectorNo element matches the selector.
variableExistsvariableThe 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.
variableNotExistsvariableThe variable is unset or empty.
variableEquals / variableNotEqualsvariable, valueExact text match (or its inverse).
variableContains / variableNotContainsvariable, valueSubstring match (or its inverse).
variableGreaterThan / variableGreaterOrEqual / variableLessThan / variableLessOrEqualvariable, valueNumeric 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 / variableNotOneOfvariable, valueThe 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.

CommandParametersWhat it does
extractRegex Extract from Txtvariable, pattern, saveToPulls 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 JSONvariable, saveToValidates 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 Fieldvariable, path, saveToReads 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 Extractionvariable, saveToLike extractField, but picks a random entry instead of a named one.