DocsFlowIF Condition

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

RunMacro IF Condition command configuration dialog showing parameter fields
Configuration dialog and parameter fields for the IF Condition command in RunMacro.
  1. Add a Control Flow › IF command to the workflow.
  2. Select the evaluation mode: Match ALL (AND) or Match ANY (OR).
  3. Add condition rows: pick target variable, comparison operator (=, !=, >, <, contains...), and reference value.
  4. (Optional) append Else If branches for alternative checks or Else for fallbacks.
  5. Place target commands inside each corresponding block branch. Close with End If. Save.

Options reference

Logical Match Mode (AND / OR)

AND requires every sub-condition to pass; OR requires at least one sub-condition to evaluate to true.

Comparison Operator

Supports equal (=), not equal (!=), greater (>), less (<), greater-or-equal (>=), less-or-equal (<=), contains, not contains, is empty, is not empty.

Variable & Comparison Value

The source variable being evaluated and the target value (supports literals, numbers, or {var} placeholders).

Else If Branch

Creates an additional conditional branch evaluated only when the preceding IF branch evaluates to false.

Else & End If

Else executes when all prior conditions fail; End If marks the structural termination of the condition block.

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

  1. Insert IF with match mode AND.
  2. Row 1: variable {balance} > 100.
  3. Row 2: variable {status} = "Active".
  4. Inside true branch: proceed with transaction.
  5. 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

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.