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

- Add a Variables › IF Variable command.
- Choose the variable, the comparison, and the target value.
- (Optional) enable negate (NOT).
- Set IF/ELSE labels. Save.
Options reference
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
- IF Variable
otp, mode Empty, NOT on (i.e. not empty). - IF label =
has_otpfor the fill step. - ELSE =
retry_otpto 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
