If / Branch

If / Branch

Run different steps depending on a condition

Note: A show_modal step inside then/else must still be the first step of that branch.

Fields

FieldTypeRequiredDescription
conditioncondition treeyesA compare ({op, a, b}), group ({op: and/or/xor, terms}), or negation ({op: 'not', term}).
thenarray of stepsnoRuns when the condition is true.
elsearray of stepsnoRuns when the condition is false.

Example

{
  "id": "01H8XGJVBWX7Y5Z3K9M2N4P6Q1",
  "type": "if",
  "condition": {
    "op": "==",
    "a": {
      "path": "user.coins"
    },
    "b": {
      "literal": 100
    }
  },
  "then": [],
  "else": []
}

Did this page help you?