DocsVariablesIF Variable

Branch on a variable value in RunMacro

RunMacro RunnerRunMacro 3.5+

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.

Dialog & quick setup

RunMacro IF Variable command configuration dialog showing parameter fields
Configuration dialog and parameter fields for the IF Variable command in RunMacro.
  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.

Options reference

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.

Modes & when to use

RunMacro Runner

Best for

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

Use an alternative when

  • Do not use it when a structural condition is clearer or string, numeric, and existence checks are mixed.
Before you run
  • Add IF Variable to the macro.
  • Prepare the data or target that IF Variable will use.

Example workflow

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.
Expected result: After execution, IF Variable completes the described action and makes its result available to the next step.

Tips & limitations

Use the Exists mode to ensure a variable was declared before using it.
  • Results depend on conversion mode; missing variables, wrong labels, or negation can choose an unexpected branch.

Applies to RunMacro 3.5+ · RunMacro Runner · Windows 10/11

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.