Skip to content

Set Variable

Type: set-variable  ·  Package: Core Activities v1.0.0

Assigns a value to a variable. It is the activity with which you create or update data by hand within the flow: initialize a counter, accumulate a text, save the result of a calculation, or change the value of a variable depending on what happens.

Unlike activities that store their result in an Output field, Set Variable exists precisely to assign a value that you define using an expression.

You indicate the name of the destination variable and the value. When executed, it evaluates the value (literal or expression =) and saves it in that variable, overwriting whatever it had. If the variable does not exist, it is declared automatically.

ParameterEditorDescription
namenombre de variableThe variable to assign. A valid name (no spaces or accents).
valueexpressionThe value to save. Literal or expression =.

Ninguno.

Initialize a counter and then increment it (typical pattern inside a loop):

Set Variable name = contador value = 0
...
For Each items = = facturas itemVariable = factura
└─ activities:
Set Variable name = contador value = = contador + 1

Accumulate a total:

Set Variable name = total value = = total + num(fila["Monto"])

Build a flag based on a condition:

Set Variable name = requiereRevision value = = total > 1000000
SymptomCausaSolution
The value is saved as text =a+bYou forgot that value needs the = to evaluatePrepend = so that it is an expression, not a literal
Variable no declarada en modo estrictoThe name does not match an existing variableCheck the exact name (case sensitive)
  • Variables — how they are declared and their scope.
  • Expressions — what you can calculate in value.