Skip to content
Docs

Workflows

Variables in expressions

Use variables in conditions and scripts – short formulas written like Python, with no curly brackets.

Some fields take an expression – a short formula that works out a value, written like Python. Use variable names on their own, and put text in quotes.

plan == "gold" and order_total >= 100

Which fields are expressions

Branch conditions, the Set variable Chat script, the Send API Payload (JSON), Send graph data and Chat script images and files in Send attachment and Show carousel.

How expressions work

  • True, False and None are written with a capital letter.
  • A variable that doesn’t exist is None, and so is a missing part after a full stop, such as order.status.
  • Square brackets are stricter. A missing key or item, such as order.items[0] when there are no items, is an error, and stops the workflow. Check first: order.items and order.items[0].name == "Lamp".
  • and, or, not, in, ==, !=, <, >, +, -, * and / work as in Python, and so does x if condition else y.

To change a value, such as rounding a number or turning text into capitals, use a function.

Stuck? Ask Advisor in the Proto dashboard, or contact us.

© Proto