Skip to content

Functions Reference

The Data Picker’s Functions tab exposes 57 helper functions that transform, format, and combine values inside placeholders. They are grouped into six categories below.

The Expand dialog at the right edge of any Data Picker field can preview a function’s resolved result while you build the expression.

Expand dialog showing a formatCurrency function call: locale 'fi-FI', currency 'EUR', and a blue Value placeholder chip as the third argument. Show result is on; the resolved value '3 193,00 €' is displayed below the field. The right sidebar shows Block Configuration for the selected Paragraph block.

  • Function call: functionName(param1;param2;param3)
  • Parameters are separated by semicolons (;)
  • Functions can be nested
  • Functions are inserted from the Data Picker’s Functions tab — you do not type them by hand
Function Parameters Description Return
capFirst(text) string Capitalizes only the first character. capFirst(hello) -> Hello string
capitalize(text) string Capitalizes first letter of each word. capitalize(hello wORLD) -> Hello WORLD string
contains(text;search) string, string Case-sensitive substring check. contains(hello world;world) -> true boolean
endsWith(text;suffix) string, string Checks if string ends with suffix. endsWith(hello;lo) -> true boolean
first(value) array/string Returns first element of array or first character. first([1,2,3]) -> 1 any/string/null
last(value) array/string Returns last element of array or last character. last([1,2,3]) -> 3 any/string/null
length(value) string/array/object Returns length of string, array, or object keys. length(hello) -> 5 number
lower(text) string Converts to lowercase. lower(HELLO) -> hello string
replace(text;search;replacement) string, string, string Replaces first occurrence. replace(hello world;world;there) -> hello there string
replaceAll(text;search;replacement) string, string, string Replaces every occurrence. replaceAll(hello world world;world;there) -> hello there there string
slice(value;start;end?) string/array, number, number? Extracts section by index. slice(hello;1;3) -> el string/array/null
split(text;delimiter?) string, string? Splits a string into an array by the delimiter. With no delimiter the string is split into individual characters. split(a,b,c;,) -> ['a','b','c'] array
startsWith(text;prefix) string, string Checks if starts with prefix. startsWith(hello;he) -> true boolean
stripHtml(html) string Removes HTML tags. stripHtml(<p>Hello <b>world</b></p>) -> Hello world string
trim(text) string Removes whitespace from both ends. trim( hello ) -> hello string
upper(text) string Converts to uppercase. upper(hello) -> HELLO string
Function Parameters Description Return
add(values...) any[] (2-10) Concatenates or adds. add(5;10) -> 15, add(hello;world) -> helloworld string/number/array/object
divide(dividend;divisor) number, number Divides first by second. divide(10;2) -> 5 number
multiply(values...) number[] (2-100) Multiplies numbers. multiply(5;3) -> 15, multiply(2;3;4) -> 24 number
round(value;decimals?) number, number? Rounds to nearest integer or decimal places. round(4.333;2) -> 4.33 number
subtract(minuend;subtrahend) number, number Subtracts second from first. subtract(10;3) -> 7 number
Function Parameters Description Return
and(values...) any[] (2-100) All values must be truthy. and(true;false;true) -> false boolean
boolean(value) any Converts any value to true or false. JavaScript truthiness, except that an empty array and an empty object are false. boolean([]) -> false, boolean([1,2]) -> true, boolean(0) -> false boolean
equals(value1;value2) any, any Deep equality with strict types. equals(5;5) -> true, equals('5';5) -> false, equals([1,2];[1,2]) -> true boolean
gt(value1;value2) number/string, number/string Greater than (numbers and dates). gt(5;3) -> true boolean
gte(value1;value2) number/string, number/string Greater than or equal. gte(5;5) -> true boolean
if(conditions...;trueValue;falseValue) any[] (3-100) Conditional with AND logic for multiple conditions. if(true;yes;no) -> yes any
lt(value1;value2) number/string, number/string Less than. lt(3;5) -> true boolean
lte(value1;value2) number/string, number/string Less than or equal. lte(3;3) -> true boolean
not(value) any Logical NOT (JavaScript truthiness). not(true) -> false, not(0) -> true boolean
notEquals(value1;value2) any, any Inequality with strict types. notEquals(5;3) -> true boolean
or(values...) any[] (2-100) Any value truthy. or(false;false;true) -> true boolean
switch(input;key1;val1;key2;val2;...default) any (3-100) Switch-case matching. switch(apple;apple;fruit;car;vehicle;unknown) -> fruit any
Function Parameters Description Return
isEmpty(value) any Checks null, undefined, empty string/array/object. isEmpty() -> true boolean
isNotEmpty(value) any Opposite of isEmpty. isNotEmpty(hello) -> true boolean
isNumber(value) any Finite number check (excludes NaN, Infinity). isNumber(123) -> true boolean
isWeekend(date) string Saturday or Sunday. isWeekend(2023-01-07) -> true boolean
useDefault(value;defaultValue) any, any Returns default if first is empty. useDefault(;fallback) -> fallback any
Function Parameters Description Return
addDays(date;days) string, number Adds days to date. addDays(2023-01-01;5) -> 2023-01-06T00:00:00.000Z string
addMonths(date;months) string, number Adds months. addMonths(2023-01-15;3) -> 2023-04-15T00:00:00.000Z string
addYears(date;years) string, number Adds years. addYears(2023-01-15;2) -> 2025-01-15T00:00:00.000Z string
daysBetween(startDate;endDate) string, string Days between dates. daysBetween(2023-01-01;2023-01-06) -> 5 number
formatDate(date;format) string, string Formats date with locale or pattern. formatDate(2023-12-25;fi-FI) -> 25.12.2023 string
formatDateTime(date;format) string, string Formats date+time. formatDateTime(2023-12-25T14:30:00;fi-FI) -> 25.12.2023 14:30 string
formatRelative(date;baseDate?;locale?) string, string?, string? Relative formatting. formatRelative(2023-01-01) -> yesterday string
subtractDays(date;days) string, number Subtracts days. subtractDays(2023-01-06;5) -> 2023-01-01T00:00:00.000Z string
subtractMonths(date;months) string, number Subtracts months. string
subtractYears(date;years) string, number Subtracts years. string
Function Parameters Description Return
formatCurrency(locale;currency;amount) string, string, number Currency formatting. formatCurrency(fi-FI;EUR;1234.56) -> 1 234,56 € string
formatList(locale;style;type;items) string, string, string, array Locale-sensitive list. Type accepts and, or, unit (also conjunction, disjunction). formatList(en-US;long;and;['A','B','C']) -> A, B, and C string
get(object;path;defaultValue?) object, string, any? Nested property access. get({"a":{"b":1}};a.b) -> 1 any
join(array;delimiter) array, string Joins array elements into a string with the given delimiter. join(['a','b','c'];, ) -> a, b, c string
map(array;property) array, string Extracts property from objects. map([{"a":1},{"a":2}];a) -> [1,2] array
sort(array;direction;locale?) array, string, string? Sorts primitives. Direction: asc, desc, natural-asc, natural-desc. Optional locale for natural sort (e.g., fi-FI). sort([3,1,2];asc) -> [1,2,3], sort(['img10','img2','img1'];natural-asc) -> ['img1','img2','img10'] array
sortBy(array;key:dir;key:dir?;locale?) array, string, string?, string? Sorts objects by key:direction pairs. Default direction asc. Supports natural-asc/natural-desc with locale. sortBy(list;lastName), sortBy(list;lastName;firstName:desc), sortBy(list;name:natural-asc;fi-FI) array
unique(array) array Removes duplicates from primitive arrays. unique([1,2,2,3]) -> [1,2,3] array
uniqueBy(array;key1;key2?) array, string, string? Removes duplicate objects by key path(s). Supports dot notation and composite keys. uniqueBy(list;id), uniqueBy(list;firstName;lastName) array