Multi-condition IF block (AND/OR, Else If) in RunMacro
Desktop ModeBrowser ModeRunMacro RunnerRunMacro 3.5+
The IF command evaluates one or more logical expressions using AND/OR rules to branch workflow execution across dedicated code paths.
Dialog & quick setup

- Add a Control Flow › IF command to the workflow.
- Select the evaluation mode: Match ALL (AND) or Match ANY (OR).
- Add condition rows: pick target variable, comparison operator (=, !=, >, <, contains...), and reference value.
- (Optional) append Else If branches for alternative checks or Else for fallbacks.
- Place target commands inside each corresponding block branch. Close with End If. Save.
Options reference
Modes & when to use
Desktop Mode
Browser Mode
RunMacro Runner
Best for
- Evaluating multiple criteria simultaneously before acting (e.g. balance > 0 AND status = "Ready").
- Handling cascading multi-path decisions using structured IF -> Else If -> Else blocks.
- Validating input parameters or extracted data rows before proceeding with dangerous tasks.
Use an alternative when
- Repeating actions a fixed number of times (use Loop or For Each instead).
- Checking pure DOM element states in browsers (prefer Smart HTML IF).
Before you run
- Required evaluation variables are declared or extracted prior to the check.
- Logical branching rules (AND or OR mode) are clearly defined.
Example workflow
Example: Verify account balance and active status
- Insert IF with match mode AND.
- Row 1: variable {balance} > 100.
- Row 2: variable {status} = "Active".
- Inside true branch: proceed with transaction.
- Close with End If.
Expected result: The runner executes commands within the first matching condition branch and jumps past End If when finished.
Tips & limitations
Use the is_not_empty operator to verify that a variable has been populated before performing calculations.
IF blocks can be nested indefinitely; RunMacro automatically renders tree indentation in the workflow editor.
- Numeric comparisons attempt auto-casting; non-numeric values fall back to lexicographical string ordering.
- Omitting the terminating End If causes workflow indentation hierarchies to become corrupted.
Applies to RunMacro 3.5+ · Desktop Mode & Browser Mode & RunMacro Runner · Windows 10/11
