Skip to content

If / Elseif / Else

Type: if  ·  Package: Core Activities v1.0.0

Make a decision: evaluate a condition and, depending on whether it is true or false, execute one group of activities or another. It is the basis of the logic of any automation — “if the total exceeds the limit, ask for approval; if not, continue.”

It supports several chained conditions: the main one (if), one or more intermediate ones (elseif) and one by default (else).

  1. Evaluate the main condition. If true, execute branch then and terminate.
  2. If false, evaluates each elseif condition in order. The first one that is true executes its branch and ends.
  3. If none are true, run branch else (if it exists).

Only one branch is executed: the first one whose condition is true.

ParameterEditorDescription
conditionexpressionBoolean condition (must start with =). Ex: = total > 1000.
ParameterEditorDescription
elseif(advanced)List of intermediate conditions {condición, then}, evaluated in order if the main one is false. They are configured visually in the Designer.

These parameters are activity blocks that are configured as lanes on the canvas, not as text.

Activities that are executed when the condition is true.

Activities that are executed when no conditions were met.

Classify an invoice according to its amount:

If condition = = num(fila["Total"]) > 1000000
├─ then:
│ Log level = warning message = "Factura alta: requiere aprobación"
│ Set Variable name = requiereAprobacion value = true
└─ else:
Log level = info message = "Factura dentro del límite"
SymptomCausaSolution
The condition always goes to elseYou compared table cells with direct ==Envuelve en str(...)/num(...) o usa eq(a,b)
Type error in conditionThe expression does not return a booleanMake sure the result is true/false
  • While — repeat while a condition is true.
  • Try / Catch — branch based on whether something fails, not based on a condition.
  • Expressions — write the condition.