If / Elseif / Else
If / Elseif / Else
Section titled “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).
How it works
Section titled “How it works”- Evaluate the main condition. If true, execute branch
thenand terminate. - If false, evaluates each
elseifcondition in order. The first one that is true executes its branch and ends. - If none are true, run branch
else(if it exists).
Only one branch is executed: the first one whose condition is true.
Required parameters
Section titled “Required parameters”| Parameter | Editor | Description |
|---|---|---|
condition | expression | Boolean condition (must start with =). Ex: = total > 1000. |
Optional parameters
Section titled “Optional parameters”| Parameter | Editor | Description |
|---|---|---|
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. |
Subflows (lanes)
Section titled “Subflows (lanes)”These parameters are activity blocks that are configured as lanes on the canvas, not as text.
then requerido
Section titled “then requerido”Activities that are executed when the condition is true.
else optional
Section titled “else optional”Activities that are executed when no conditions were met.
Example
Section titled “Example”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"Common errors
Section titled “Common errors”| Symptom | Causa | Solution |
|---|---|---|
The condition always goes to else | You compared table cells with direct == | Envuelve en str(...)/num(...) o usa eq(a,b) |
| Type error in condition | The expression does not return a boolean | Make sure the result is true/false |
Related activities
Section titled “Related activities”- While — repeat while a condition is true.
- Try / Catch — branch based on whether something fails, not based on a condition.
- Expressions — write the condition.