Transform a value without another block
In text fields, helpers are used between {{ and }} to transform, count, filter, or display a value.
Text
| Helper | Example | Result |
|---|---|---|
uppercase | {{uppercase "wikit"}} | WIKIT |
lowercase | {{lowercase "URGENT"}} | urgent |
capitalize | {{capitalize "hello"}} | Hello |
trim | {{trim " hello "}} | hello |
truncate | {{truncate description 80}} | First 80 characters |
replace | {{replace ref "EN-" ""}} | EN-1024 becomes 1024 |
split | {{split "a,b,c" ","}} | ['a', 'b', 'c'] |
contains | {{contains userMessage "urgent"}} | true or false |
startsWith | {{startsWith reference "EN-"}} | true when the text starts with EN- |
endsWith | {{endsWith userData.email "@wikit.ai"}} | true when the text ends with @wikit.ai |
Numbers
| Helper | Example | Result |
|---|---|---|
add | {{add daysTaken 5}} | 12 + 5 → 17 |
subtract | {{subtract quota daysTaken}} | 25 - 12 → 13 |
multiply | {{multiply price quantity}} | 10 × 3 → 30 |
divide | {{divide total 2}} | 30 ÷ 2 → 15 |
mod | {{mod turnNumber 2}} | Division remainder: 7 mod 2 → 1 |
round | {{round 4.7}} | 5 |
floor / ceil | {{floor 4.7}} / {{ceil 4.2}} | Rounded down 4 / up 5 |
abs | {{abs gap}} | -3 → 3 |
min / max | {{min quota 10}} / {{max score 0}} | Smallest / largest value |
toInt | {{toInt "42.9"}} | 42 |
fixed | {{fixed 3.14159 2}} | 3.14 |
Lists
| Helper | Example | Result |
|---|---|---|
length | {{length documents.body}} | Number of items |
first | {{first results}} | First item |
last | {{last results}} | Last item |
join | {{join tags ", "}} | hr, payroll, leave |
sort | {{sort names}} | Sorted list |
reverse | {{reverse history}} | Reversed list |
slice | {{slice results 0 3}} | First three items |
at | {{at results 1}} | Second item (numbering starts at 0) |
includes | {{includes tags "hr"}} | true when the list contains hr |
concat | {{concat listA listB}} | Lists merged into one |
To check whether a list is empty, compare its length with zero: eq (length documents.body) 0.
Objects
| Helper | Example | Result |
|---|---|---|
get | {{get user "email"}} | Value of email |
has | {{has user "email"}} | true when the email field exists |
isEmpty | {{isEmpty filters}} | true when the object has no property |
keys | {{keys response.body}} | Property names |
values | {{values response.body}} | Object values |
json | {{json user}} | Object displayed as JSON |
parseJson | {{parseJson "[1, 2, 3]"}} | Text converted into a list |
merge | {{merge profile preferences}} | Merged objects |
Conditions
| Helper | Example | Result |
|---|---|---|
eq | eq status "open" | True when equal |
ne | ne status "closed" | True when different |
gt / gte | gte score 70 | Greater than, optionally equal |
lt / lte | lt attempts 3 | Lower than, optionally equal |
and / or / not | and (gte score 70) (not vip) | Logical combination |
match | match email "@wikit\\.ai$" | Regex match |
length | eq (length documents.body) 0 | True when the list is empty |
Condition Expression field
Write gte score 70 directly, without {{ or }}. Braces are only used in text fields.
Debugging and conversion
| Helper | Example | Result |
|---|---|---|
codeblock | {{codeblock documents.body}} | Formatted debug value |
toQueryString | {{toQueryString filters}} | ?status=open&page=2 |
toJson | {{toJson request}} | Object serialized for an HTTP body |
Remove codeblock displays before publication when they might contain secrets or personal data.