Functions
What you can do inside an expression block, beyond simple path navigation.
The expression engine is intentionally small, most "function-like" behaviour lives in dedicated nodes (Text Processing, DateTime Operations, Data Transform). What follows is what the inline evaluator natively supports.
Arithmetic
Inside {{ }} you can do basic math:
{{ $trigger.body.subtotal + $trigger.body.tax }}
{{ $trigger.body.amount * 1.2 }}
{{ $node["List"].json.items.length - 1 }}
{{ $trigger.body.cents / 100 }}Supported: +, -, *, /. No %, no **. For modulo or exponentiation, use a Code node.
Operator precedence follows the usual rules (* and / before + and -). Use parentheses if in doubt:
{{ ($trigger.body.subtotal + $trigger.body.shipping) * 1.2 }}String methods (chained on a value)
A small set of string methods is available directly in expressions:
| Method | What it does |
|---|---|
.toLowerCase() |
Lower-case the string |
.toUpperCase() |
Upper-case the string |
.trim() |
Strip leading and trailing whitespace |
{{ $trigger.body.email.toLowerCase() }}
{{ $trigger.body.code.toUpperCase().trim() }}For anything richer, replace, regex, substring, padding, use the Text Processing node.
Array operations
| Property / method | What it returns |
|---|---|
.length |
Number of items in an array (or characters in a string) |
[index] |
Element at zero-based index |
{{ $node["Search"].json.results.length }}
{{ $node["Search"].json.results[0].title }}
{{ $node["Search"].json.results[$node["Search"].json.results.length - 1].title }}For filter / map / reduce / sort, use the Data Transform node, much more readable.
Comparison and logical operators (inside {{ }})
| Op | Meaning |
|---|---|
== |
Equal |
!= |
Not equal |
<, >, <=, >= |
Comparison |
&& |
Logical AND |
| ` |
{{ $trigger.body.amount > 1000 && $trigger.body.country == "US" }}These produce a value (typically a boolean) that gets substituted into the surrounding string. They don't branch execution, for branching, use an If node.
What's not built in
| You want… | Use this instead |
|---|---|
| Conditional (ternary) | Code node, or an If node that splits the workflow |
| ` | |
formatDate(date, "yyyy-MM-dd") |
DateTime Operations node |
length on objects |
Data Transform's aggregate: count |
upper, lower (free function form) |
The .toUpperCase() method form above |
join(array, ",") |
Text Processing's join op |
| Math functions (round, floor, abs, max, min) | Code node, or Data Transform's calculate |
ℹ️ Older Flero docs sometimes referenced free-function helpers like
upper(name)orlength(items). Those were planned but never shipped, use the node forms above instead. If you're updating an older workflow that has them, an[EXPR-ERROR: unknown reference …]marker will flag the spot.
Tips & gotchas
- Keep expression bodies small. Anything more than a path lookup plus light arithmetic / string method belongs in a dedicated node, it's more readable, more testable, and the inspector can preview it.
- Operator precedence inside
{{ }}is the standard one. Use parens if there's any ambiguity. The evaluator does not have implicit string concatenation, assemble strings via interpolation:"prefix-{{ x }}-suffix", not"prefix-" + x + "-suffix". - Null + number = null, not zero. Guard with an If or a Data Transform default if upstream data may be missing.
Related
Found something out of date? This page lives in the Flero docs content set.