Docs

RunMacro Documentation

Create your first robot, then go further as needed.

Clear step-by-step guides to create, run, and improve robots for repetitive computer work.

Docs Variables IF Variable
🔀 Variables

Branch on a variable value in RunMacro

The IF Variable command checks a variable against a condition (equals, contains, greater, empty, exists) and steers the workflow: true jumps to IF, false to ELSE.

Prerequisites#

  • Add IF Variable to the macro.
  • Prepare the data or target that IF Variable will use.

Supported modes#

  • RunMacro Runner

What it does#

The IF Variable command checks a variable against a condition (equals, contains, greater, empty, exists) and steers the workflow: true jumps to IF, false to ELSE.

Screenshots & video#

RunMacro IF Variable command configuration dialog showing parameter fields
Configuration dialog and parameter fields for the IF Variable command in RunMacro.

When to use it#

  • Only proceed when a variable meets a condition.
  • Handle differently based on a variable value.
  • Check whether a variable has data (exists/empty).

When not to use it#

  • Do not use it when a structural condition is clearer or string, numeric, and existence checks are mixed.

Configuration steps#

  1. Add a Variables › IF Variable command.
  2. Choose the variable, the comparison, and the target value.
  3. (Optional) enable negate (NOT).
  4. Set IF/ELSE labels. Save.

Every option explained#

Variable#

The variable to check.

Comparison mode#

Equals, Contains, Greater (number), Empty, Exists.

Target value + Negate (NOT)#

The value to compare; enable NOT to invert the result.

IF label / ELSE label#

If true jump to IF; otherwise jump to ELSE.

Expected result#

After execution, IF Variable completes the described action and makes its result available to the next step.

Real example#

Example: continue only when OTP exists#

  1. IF Variable otp, mode Empty, NOT on (i.e. not empty).
  2. IF label = has_otp for the fill step.
  3. ELSE = retry_otp to try again.

Limitations and failure cases#

  • Results depend on conversion mode; missing variables, wrong labels, or negation can choose an unexpected branch.

Tips & common mistakes#

Use the Exists mode to ensure a variable was declared before using it.

Verification details#

  • commands/variables.py
RunMacro robot

Robots do the work. Your time is yours.

Create a robot in minutes, no coding needed. Reliable execution, remote management, transparent costs — and you always stay in control.