DocsVariablesDeclare Variable

Declare a variable (Global/Dynamic) in RunMacro

RunMacro RunnerRunMacro 3.5+

The Declare Variable command creates a named variable to store reusable data.

Dialog & quick setup

RunMacro Declare Variable command configuration dialog showing parameter fields
Configuration dialog and parameter fields for the Declare Variable command in RunMacro.
  1. Add a Variables › Declare Variable command.
  2. Set the variable name (e.g. email).
  3. Choose the type: Global or Dynamic.
  4. (Optional) enter an initial value. Save. Reference it as {email}.

Options reference

Variable name

The identifier used as {var_name} in text fields.

Type (Global / Dynamic)

Global keeps its value across the run; Dynamic is temporary data that changes often (e.g. per loop).

Initial value

The value set at declaration time. May contain other variables.

Modes & when to use

RunMacro Runner

Best for

  • Store a value for use in later steps (e.g. email, name).
  • Prepare a variable before assigning data from a file/clipboard.
  • Separate dynamic data from fixed content.

Use an alternative when

  • Do not use it for a one-off value when Assign Variable is enough and no explicit scope is needed.
Before you run
  • Add Declare Variable to the macro.
  • Prepare the data or target that Declare Variable will use.

Example workflow

Example: declare a counter variable

  1. Declare Variable count, Global, value 0.
  2. In a loop, use Calculate to increment count.
  3. Reference {count} where needed.
Expected result: After execution, Declare Variable completes the described action and makes its result available to the next step.

Tips & limitations

Use Dynamic for per-loop data (email, password); Global for fixed config.
  • The runner manages Global/Dynamic scope; duplicate names change state and variables are not lexical scopes.

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.