Skip to content

Functions Reference ​

Type: Reference | Audience: Interface builder user

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.

Syntax ​

  • 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

Categories ​

Text Processing (16 functions) ​

FunctionParametersReturnDescription
capFirst(text)stringstringCapitalizes only the first character. capFirst(hello) -> Hello
capitalize(text)stringstringCapitalizes first letter of each word. capitalize(hello wORLD) -> Hello WORLD
contains(text;search)string, stringbooleanCase-sensitive substring check. contains(hello world;world) -> true
endsWith(text;suffix)string, stringbooleanChecks if string ends with suffix. endsWith(hello;lo) -> true
first(value)array/stringany/string/nullReturns first element of array or first character. first([1,2,3]) -> 1
last(value)array/stringany/string/nullReturns last element of array or last character. last([1,2,3]) -> 3
length(value)string/array/objectnumberReturns length of string, array, or object keys. length(hello) -> 5
lower(text)stringstringConverts to lowercase. lower(HELLO) -> hello
replace(text;search;replacement)string, string, stringstringReplaces first occurrence. replace(hello world;world;there) -> hello there
replaceAll(text;search;replacement)string, string, stringstringReplaces every occurrence. replaceAll(hello world world;world;there) -> hello there there
slice(value;start;end?)string/array, number, number?string/array/nullExtracts section by index. slice(hello;1;3) -> el
split(text;delimiter?)string, string?arraySplits 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']
startsWith(text;prefix)string, stringbooleanChecks if starts with prefix. startsWith(hello;he) -> true
stripHtml(html)stringstringRemoves HTML tags. stripHtml(<p>Hello <b>world</b></p>) -> Hello world
trim(text)stringstringRemoves whitespace from both ends. trim( hello ) -> hello
upper(text)stringstringConverts to uppercase. upper(hello) -> HELLO

Mathematics (5 functions) ​

FunctionParametersReturnDescription
add(values...)any[] (2-10)string/number/array/objectConcatenates or adds. add(5;10) -> 15, add(hello;world) -> helloworld
divide(dividend;divisor)number, numbernumberDivides first by second. divide(10;2) -> 5
multiply(values...)number[] (2-100)numberMultiplies numbers. multiply(5;3) -> 15, multiply(2;3;4) -> 24
round(value;decimals?)number, number?numberRounds to nearest integer or decimal places. round(4.333;2) -> 4.33
subtract(minuend;subtrahend)number, numbernumberSubtracts second from first. subtract(10;3) -> 7

Logic & Comparison (12 functions) ​

FunctionParametersReturnDescription
and(values...)any[] (2-100)booleanAll values must be truthy. and(true;false;true) -> false
boolean(value)anybooleanConverts 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
equals(value1;value2)any, anybooleanDeep equality with strict types. equals(5;5) -> true, equals('5';5) -> false, equals([1,2];[1,2]) -> true
gt(value1;value2)number/string, number/stringbooleanGreater than (numbers and dates). gt(5;3) -> true
gte(value1;value2)number/string, number/stringbooleanGreater than or equal. gte(5;5) -> true
if(conditions...;trueValue;falseValue)any[] (3-100)anyConditional with AND logic for multiple conditions. if(true;yes;no) -> yes
lt(value1;value2)number/string, number/stringbooleanLess than. lt(3;5) -> true
lte(value1;value2)number/string, number/stringbooleanLess than or equal. lte(3;3) -> true
not(value)anybooleanLogical NOT (JavaScript truthiness). not(true) -> false, not(0) -> true
notEquals(value1;value2)any, anybooleanInequality with strict types. notEquals(5;3) -> true
or(values...)any[] (2-100)booleanAny value truthy. or(false;false;true) -> true
switch(input;key1;val1;key2;val2;...default)any (3-100)anySwitch-case matching. switch(apple;apple;fruit;car;vehicle;unknown) -> fruit

Data Validation (5 functions) ​

FunctionParametersReturnDescription
isEmpty(value)anybooleanChecks null, undefined, empty string/array/object. isEmpty() -> true
isNotEmpty(value)anybooleanOpposite of isEmpty. isNotEmpty(hello) -> true
isNumber(value)anybooleanFinite number check (excludes NaN, Infinity). isNumber(123) -> true
isWeekend(date)stringbooleanSaturday or Sunday. isWeekend(2023-01-07) -> true
useDefault(value;defaultValue)any, anyanyReturns default if first is empty. useDefault(;fallback) -> fallback

Date & Time (10 functions) ​

FunctionParametersReturnDescription
addDays(date;days)string, numberstringAdds days to date. addDays(2023-01-01;5) -> 2023-01-06T00:00:00.000Z
addMonths(date;months)string, numberstringAdds months. addMonths(2023-01-15;3) -> 2023-04-15T00:00:00.000Z
addYears(date;years)string, numberstringAdds years. addYears(2023-01-15;2) -> 2025-01-15T00:00:00.000Z
daysBetween(startDate;endDate)string, stringnumberDays between dates. daysBetween(2023-01-01;2023-01-06) -> 5
formatDate(date;format)string, stringstringFormats date with locale or pattern. formatDate(2023-12-25;fi-FI) -> 25.12.2023
formatDateTime(date;format)string, stringstringFormats date+time. formatDateTime(2023-12-25T14:30:00;fi-FI) -> 25.12.2023 14:30
formatRelative(date;baseDate?;locale?)string, string?, string?stringRelative formatting. formatRelative(2023-01-01) -> yesterday
subtractDays(date;days)string, numberstringSubtracts days. subtractDays(2023-01-06;5) -> 2023-01-01T00:00:00.000Z
subtractMonths(date;months)string, numberstringSubtracts months.
subtractYears(date;years)string, numberstringSubtracts years.

Data Manipulation (9 functions) ​

FunctionParametersReturnDescription
formatCurrency(locale;currency;amount)string, string, numberstringCurrency formatting. formatCurrency(fi-FI;EUR;1234.56) -> 1 234,56 €
formatList(locale;style;type;items)string, string, string, arraystringLocale-sensitive list. Type accepts and, or, unit (also conjunction, disjunction). formatList(en-US;long;and;['A','B','C']) -> A, B, and C
get(object;path;defaultValue?)object, string, any?anyNested property access. get({"a":{"b":1}};a.b) -> 1
join(array;delimiter)array, stringstringJoins array elements into a string with the given delimiter. join(['a','b','c'];, ) -> a, b, c
map(array;property)array, stringarrayExtracts property from objects. map([{"a":1},{"a":2}];a) -> [1,2]
sort(array;direction;locale?)array, string, string?arraySorts 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']
sortBy(array;key:dir;key:dir?;locale?)array, string, string?, string?arraySorts 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)
unique(array)arrayarrayRemoves duplicates from primitive arrays. unique([1,2,2,3]) -> [1,2,3]
uniqueBy(array;key1;key2?)array, string, string?arrayRemoves duplicate objects by key path(s). Supports dot notation and composite keys. uniqueBy(list;id), uniqueBy(list;firstName;lastName)