Filters and functions
Shape values with filters and look up more data with functions: dates and times, text, numbers, JSON, encodings, and the alarm functions evalink talos adds.
A filter follows a value after a pipe |. Filters chain from left to right:
{{ device.name | upper | abbreviate(20) }}
A function is called by name with parentheses:
{{ alarmShareLink() }}
Dates and times
Timestamps in evalink talos are milliseconds. now is the current time.
| Filter | Does |
|---|---|
date |
Formats a date or timestamp. Arguments: output format, input format, timeZone. The time zone is the site's by default. Without a format: dd.MM.yyyy HH:mm:ss. An empty value prints nothing. |
toTime |
A time of day: time (default 00:00), daysLater (default 0), time zone (the site's by default). If that moment has already passed, it moves to the next day. |
toMillis |
Turns date text into a timestamp: format (default dd/MM/yyyy HH:mm), time zone (default UTC). |
The alarm time in the site's time zone:
{{ alarm.timestamp | date('dd.MM.yyyy HH:mm') }}
The same in another time zone. Pass the time zone by name, because the second argument of date is the input format:
{{ alarm.timestamp | date('dd.MM.yyyy HH:mm', timeZone='Europe/Zurich') }}
Tomorrow at 08:00 in the site's time zone:
{{ now | toTime('08:00', 1) | date('dd.MM.yyyy HH:mm') }}
Output, on 1 December 2026 at 15:30: 02.12.2026 08:00. Without the 1, toTime('08:00') gives the next 08:00.
A date from text:
{{ "31/12/2025 14:30" | toMillis | date('d MMMM yyyy') }}
Text
| Filter | Does |
|---|---|
default |
A fallback when the value is empty |
trim, upper, lower, capitalize, title |
Spaces and case |
abbreviate |
Cuts to a length, with ... |
replace |
Replaces text, given as a map |
split, join |
Text to a list and back |
extractText |
The first match of a pattern; the second argument is the group, default 1 |
urlEncode |
Text made safe for a link; a space becomes + |
{{ device.name | default('Unknown site') }}
{{ alarm.alarmName | upper }}
{{ alarm.alarmDescription | abbreviate(40) }}
{{ "Hi %n%" | replace({'%n%': device.name}) }}
{{ "a,b,c" | split(',') | join(' / ') }}
{{ "Zone 12 open" | extractText('Zone ([0-9]+)') }}
{{ device.name | urlEncode }}
The extractText example prints 12.
Numbers and lists
| Filter | Does |
|---|---|
toInt, toLong, toFloat, toString |
Convert between types. Text that isn't a number makes the template fail. |
numberformat |
Formats a number |
length, first, last, slice, sort, reverse |
List basics |
distinct |
A list without duplicates |
shuffle |
A list in random order |
{{ "42" | toInt + 1 }}
{{ 3.14159 | numberformat('#.00') }}
{{ alarms() | length }}
{{ [1, 1, 2] | distinct }}
Output: 43, 3.14, the number of the workflow's alarms, [1, 2].
JSON
| Does | |
|---|---|
json filter, toJson() or dump() function |
A value as indented JSON |
fromJson() function |
JSON text to data you can read with dots |
get filter |
A value by JSON path, for example $.a.b[1] |
Read a field from a JSON payload:
{{ fromJson(alarm.payload).temperature }}
Pick a nested value by path:
{{ fromJson(alarm.payload) | get('$.readings[0].value') }}
get expects the path to exist. For a site's custom field, device.attributes['Color'] is simpler.
Encodings
| Filter | Does |
|---|---|
bytes |
Text to bytes (UTF-8). Works on text only. |
base64, hex |
Bytes to Base64 or hexadecimal text |
decodeBase64, decodeHex |
Base64 or hex text back to bytes |
toString |
Bytes back to text |
Text as Base64:
{{ 'user:pass' | bytes | base64 }}
Output: dXNlcjpwYXNz. Don't apply filters to env(): in a Trigger Web Hook step the variable is filled in only when the step sends, after the filters have run. For basic authentication, use the authentication settings of the step.
Decoded text needs toString at the end:
{{ "dXNlcjpwYXNz" | decodeBase64 | toString }}
Functions for the alarm
These need an alarm: they work in workflow steps, notifications and other texts about an alarm.
| Function | Returns |
|---|---|
alarmMessage(lang) |
The standard alarm message, for example {{ alarmMessage('de') }} |
alarmText(lang, zone) |
The short alarm text; zone=false leaves the zone out |
alarmName(lang), alarmDescription(lang) |
Name and description of the alarm code |
alarmMeaning(lang) |
Name, description and meta values of the alarm code |
alarmDefinition() |
The alarm definition that applies |
alarmShareLink() |
A temporary link to share the alarm, valid 60 minutes |
currentAlarm() |
The alarm as it is stored now, for example {{ currentAlarm().alarmStatus }} |
alarms() |
In a workflow: all its alarms, its own and attached ones, oldest first |
files() |
The alarm's files, images and videos under 1 MB, each with name, contentType, size and data |
virtualDevice() |
The receiver of the alarm: account, name, type and connection state |
deviceType() |
The site type of the site |
lang is optional: by default the language of the text.
Other functions
| Function | Returns |
|---|---|
env('NAME') |
A company environment variable. See Environment variables. |
random(from, to) |
A whole number from from up to, not including, to. Defaults 0 and 10. |
phoneTts(phone) |
For Twilio calls: a phone number spelled out in groups, so the voice reads it clearly |
Operators and tests
| Logic | and, or, not |
| Comparison | ==, !=, <, >, <=, >=, contains |
| Arithmetic | +, -, *, /, % |
| Join text | ~, for example {{ device.name ~ ' (' ~ alarm.alarmCode ~ ')' }} |
| Choose | condition ? a : b |
| Tests | is empty, is null, is defined, is even, is odd, each also with not: is not empty |
There is no regular-expression operator: to test for a pattern, use extractText and check that the result is not empty.