Skip to content

Update Variable – setting variables of the action

The command "Update Variable" writes values into variables of the action. It is the usual way to keep an intermediate result, count something or prepare values for later commands. This page is for administrators who build actions.


1. At a glance

Purpose Set one or several variables
Typical use Defaults at the start, counters and sums in loops, a value prepared for a later command
Where in the editor Toolbar menu "Data" → "Update Variable"
Needs a user interface No
Needs a current record No (the expressions may read one)
Related Action variables, Update Global Value, Switch

2. Settings

The entries are on the tab "Set Variables". Like every command, the command also has "Display Name", "Description" and "Execution Condition" on the tab "General" (see Actions).

Each entry ("Value Templates") has:

Part Meaning Default / Required
"Condition" Logical expression; the variable is only written if it is true Empty: always written
"Variable" A variable of the action (declared on the tab "Variables" of the action) Required
"Value" Expression for the value, evaluated against the current record Required

The arrows next to an entry change the order.


3. Behaviour

  1. The entries are processed in order. Entries without variable or value are skipped.
  2. For each entry the condition is checked, then the value is computed and written.
  3. An entry sees the variables as the entries before it left them – an entry can use the value an earlier entry of the same command has just written.

The variable keeps whatever type of value the expression returns (text, number, date, …). It keeps the value until it is written again or the run ends.


4. Examples

Defaults at the start. First command of an action: "Total" = 0, "Errors" = "" (empty text), "Started" = now.

Counter in a loop. Inside For Each Related Record: "Total" = "Total + Amount", and with "Condition" "Amount > 1000": "Large positions" = "Large positions + 1".

Prepare a text. "Mail subject" = a text expression that joins "Order", the order number and the customer name – used later by Send E-Mail and Write Log.


5. Limitations

  • Only variables of this action can be written. Values for a called action are handed over as arguments of Execute Action.
  • A variable cannot be created by the command – declare it first (see Action variables).