Advanced expression editor syntax syntax

Syntax basics when using the Advanced expression editor are listed below.

Parentheses and expression priority parentheses-and-expression-priority

Parentheses can be used to make a complex expression more readable. (<expression>) is the equivalent of <expression>. Parenthesis can also be used to define the evaluation order and associativity.

The expressions will be evaluated from left to right. The associativity on arithmetic operators must be applied: multiplications and divisions take priority over additions and subtractions. In order to impose a specific order, parenthesis must be added to delimit the operations. For example:

Expression
Evaluation
4 + 2 * 10
  • ‘*’ takes priority over ‘+’: 2 * 10 is evaluated → 20
  • 4 + 20 → 24
(4 + 2) * 10
  • The parentheses change the priority: (4 + 2) is evaluated → 6
  • 6 * 10 → 60

Case sensitivity case-sensitivity

Here are the different case sensitivity rules:

  • All operators (and, or, etc.) should be written lowercase. For instance, <expression1> and <expression2> is a valid expression whereas the expression <expression1> AND <expression2> is not.
  • All function names are case sensitive. For instance, inAudience() is valid whereas the function INAUDIENCE() is not.
  • Field references and constant values are case sensitive: they are not built-in elements of the language (as opposed to operators and functions), they are authored by the end user.

Returned expression type returned-expression-type

Depending on the context of use, the expression editor can return different values.

Advanced expression editor usage
Expected returned expression type
Condition (data source condition, date condition)
boolean
Custom timer
dateTimeOnly
Action parameters mapping
Any
AI Knowledge Reference

This section contains structured knowledge intended to support interpretation, retrieval, and question answering related to this topic.

For complete understanding, this information should be combined with the documentation on this page. Neither source is intended to stand alone; the page describes the feature, while this section provides additional context that helps disambiguate terminology, intent, applicability, and constraints.

  • TL;DR: This page covers the core syntax rules of the Journey advanced expression editor — operator precedence with parentheses, case sensitivity for operators and functions, and the expected return type for each editor context.

Intents:

  • Control expression evaluation order by wrapping sub-expressions in parentheses
  • Write operators (and, or, not) in lowercase to avoid syntax errors
  • Use correctly cased function names (e.g. inAudience() not INAUDIENCE())
  • Understand that conditions must return a boolean, custom timers must return dateTimeOnly, and action parameter mappings can return any type

Glossary:

  • Expression priority: The order in which operators are evaluated; multiplications and divisions take priority over additions and subtractions (product-specific)
  • Case sensitivity: In the advanced editor, operators must be lowercase, function names are case-sensitive, and field references are case-sensitive as authored by the user (product-specific)
  • dateTimeOnly: The return type required for custom timer (Wait activity) expressions; represents a date-time without a timezone (product-specific)

Guardrails:

  • Operators (and, or, not, etc.) must be written in lowercase — uppercase variants are invalid
  • All function names are case-sensitive — inAudience() is valid but INAUDIENCE() is not
  • Arithmetic follows standard precedence: * and / evaluate before + and -; use parentheses to override
  • Conditions always return a boolean; custom timers always return dateTimeOnly

Terminology:

  • Canonical name: Advanced Expression Editor Syntax — Acronym: none — variants: expression syntax, editor syntax
  • Synonyms: “expression priority” = “operator precedence”; “parentheses” = “brackets” (in expression context)
  • Do not confuse: operator case sensitivity (operators must be lowercase) ≠ field reference case sensitivity (field names are user-authored and case-sensitive as written)

FAQ:

  • Q: Does 4 + 2 * 10 evaluate to 60 or 24? — It evaluates to 24 because * takes priority over +; use (4 + 2) * 10 to get 60.
  • Q: Can I write AND in uppercase in an expression? — No; all operators must be lowercase (and, or, not).
  • Q: Are function names case-sensitive? — Yes; inAudience() is valid but INAUDIENCE() is not.
  • Q: What type must a condition expression return? — A boolean.
  • Q: What return type is required for a custom Wait activity timer expression?dateTimeOnly.
recommendation-more-help
journey-optimizer-help