Skip to main content
This page documents ABL’s expression language: operators, variable paths, {{}} template-string interpolation, the 36 built-in functions, and type coercion rules. Expressions are used in conditions (WHEN, CHECK, constraint rules), value assignments (SET), template interpolation ({{}}), and function calls. For rich content output formats (voice, cards, carousels, interactive actions, templates), see Rich content.

Expression syntax

Comparison operators

Logical operators

Write logical operators in uppercase (AND, OR, NOT). ! is also accepted as a prefix negation.

Unary operators

Operator precedence

  1. Parentheses ()
  2. Unary operators (NOT, IS SET, IS NOT SET)
  3. Comparison operators (==, !=, >, <, >=, <=, contains, matches)
  4. AND
  5. OR
Use parentheses to override default precedence:

Variable paths and dot notation

Reference variables using dot notation to access nested values.

Path resolution rules

  • The evaluator looks up the full path in the session context.
  • The Platform resolves each segment left to right: user.address.city resolves user, then address on the result, then city.
  • If any segment resolves to null or undefined, the entire path resolves to undefined.
  • Array access uses bracket notation: items[0], items[2].name.

Template strings

Template strings use {{}} syntax for variable interpolation within RESPOND, summary, and other string properties — including inside a TEMPLATES: block body:

Conditional sections

Templates support conditional rendering with {{#if}}...{{/if}}:

Function calls in templates

You can call built-in functions within template strings:

Built-in function reference

ABL provides 36 built-in functions organized into seven categories (plus the CEL-only content-analysis helpers described below). All functions are called with FUNCTION_NAME(arg1, arg2, ...) syntax. Function names are uppercase.

Math functions

Math functions coerce string arguments to numbers automatically: ADD("2", "3") returns 5.

String functions

The string functions gracefully handle null and undefined and return an empty string: UPPER(null) returns "". To prevent memory issues, the limit on string output is 100,000 characters.

Formatting functions

The mask patterns are explained below. The default mask character is *. Pass a third argument to use a different character: MASK(ssn, "last4", "x"). The date format uses the following notations: Example: FORMAT_DATE("2024-03-15T10:30:00Z", "YYYY-MM-DD HH:mm") returns "2024-03-15 10:30". FORMAT_DATE formats in UTC by default — a date-time string without an explicit offset is interpreted as UTC, so the output is deterministic regardless of where the runtime executes. Pass an optional IANA timezone name as the third argument to format in that zone instead:
An unrecognized timezone falls back to UTC.

Type checking and coercion functions

Array functions

Object functions

OBJECT_KEYS and OBJECT_VALUES return an empty array for non-object inputs (null, arrays, strings). OBJECT_MERGE accepts any number of arguments and skips non-object values.

Utility functions

COALESCE considers 0 and false as valid (non-null) values: COALESCE(0, "fallback") returns 0. UNIQUE_ID generates a random alphanumeric string suitable for reference numbers. It is not cryptographically secure — do not use it for tokens or secrets.

Content-analysis functions (CEL guardrails)

CEL-based guardrail checks have access to an additional abl.* namespace of content-analysis helpers:
In CEL expressions the core functions above are also available under the abl. namespace with lowercase names (e.g. abl.upper(x)), and CEL-native operators (&&, ||, !, %, in, ternary ? :) and macros (size(), has()) can be used.
abl.pii_equal(left, right) compares two values without ever exposing the underlying plaintext to the expression — both left and right must be live PII-vault tokens (the opaque form a PII-classified value takes once captured, e.g. via a sensitive: true GATHER field), and the comparison happens inside the vault itself. Values are canonicalized before comparing (email lowercased/trimmed, phone/SSN/credit-card digits-only, etc.), so abl.pii_equal(session.data.values.email, caller_provided_email) matches Member@Example.com against member@example.com.
If either operand isn’t a live vault token for the same PII type — missing, expired, or a plain string — abl.pii_equal throws rather than returning false. This is deliberate: silently returning false on a fault would make !abl.pii_equal(x, y) evaluate true on a comparison that couldn’t actually be performed. Guard against this with IS SET checks on both operands before comparing, or route the resulting evaluation error through your usual error handling.

Nested function calls

Functions can be nested as arguments to other functions:
Nesting is limited to a maximum depth of 32 to prevent stack overflow.

Using expressions in ABL

In conditions (WHEN, CHECK, constraint rules)

In SET assignments

In template interpolation

In TRANSFORM pipelines

Type coercion rules

The evaluator applies these coercion rules during expression evaluation:
Related articles: