Reference
Functions reference
Every function an expression can call.
These are the only functions available inside {{ }} templates, $expr values and visibleWhen. See Expressions for the syntax.
| Function | What it returns |
|---|---|
len(value) | Length of a list, text or object. |
upper(text) | Upper-case text. |
lower(text) | Lower-case text. |
trim(text) | Remove surrounding whitespace. |
truncate(text, length) | Cut text to a maximum length. |
includes(listOrText, value) | Whether a list or text contains a value. |
join(list, separator) | Join a list into text. |
round(number, decimals) | Round a number. |
floor(number) | Round down. |
ceil(number) | Round up. |
abs(number) | Absolute value. |
min(a, b, …) | Smallest value. |
max(a, b, …) | Largest value. |
sum(list, key?) | Sum a list, optionally by a key of each item. |
count(list, key?, value?) | Count items, optionally those whose key is truthy or equals a value. |
first(list) | First item. |
last(list) | Last item. |
formatNumber(number, decimals?) | Format with thousands separators. |
formatCurrency(number, currency) | Format as money, e.g. formatCurrency(12.5, "EUR"). |
formatPercent(fraction, decimals?) | Format 0.42 as 42%. |
formatBytes(number) | Format a byte count. |
formatDate(date, style?) | Format a date. Style is short, medium, long or full. |
formatTime(date) | Format the time of day. |
formatDateTime(date) | Format date and time. |
relativeTime(date) | "5 minutes ago", "in 2 days". |
now() | Current time in milliseconds. |
string(value) | Convert to text. |
number(value) | Convert to a number. |
default(value, fallback) | Fallback when a value is empty. |