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.

<img
  src="https://res.cloudinary.com/zimple/image/upload/f_auto,q_auto/v1778048021/interface-docs/functions-hero.png"
  alt="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."
  width="1440"
  height="900"
  loading="lazy"
/>

## 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)

| Function | Parameters | Return | Description |
|----------|-----------|--------|-------------|
| `capFirst(text)` | string | string | Capitalizes only the first character. `capFirst(hello)` -> `Hello` |
| `capitalize(text)` | string | string | Capitalizes first letter of each word. `capitalize(hello wORLD)` -> `Hello WORLD` |
| `contains(text;search)` | string, string | boolean | Case-sensitive substring check. `contains(hello world;world)` -> `true` |
| `endsWith(text;suffix)` | string, string | boolean | Checks if string ends with suffix. `endsWith(hello;lo)` -> `true` |
| `first(value)` | array/string | any/string/null | Returns first element of array or first character. `first([1,2,3])` -> `1` |
| `last(value)` | array/string | any/string/null | Returns last element of array or last character. `last([1,2,3])` -> `3` |
| `length(value)` | string/array/object | number | Returns length of string, array, or object keys. `length(hello)` -> `5` |
| `lower(text)` | string | string | Converts to lowercase. `lower(HELLO)` -> `hello` |
| `replace(text;search;replacement)` | string, string, string | string | Replaces first occurrence. `replace(hello world;world;there)` -> `hello there` |
| `replaceAll(text;search;replacement)` | string, string, string | string | Replaces every occurrence. `replaceAll(hello world world;world;there)` -> `hello there there` |
| `slice(value;start;end?)` | string/array, number, number? | string/array/null | Extracts section by index. `slice(hello;1;3)` -> `el` |
| `split(text;delimiter?)` | string, string? | array | 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']` |
| `startsWith(text;prefix)` | string, string | boolean | Checks if starts with prefix. `startsWith(hello;he)` -> `true` |
| `stripHtml(html)` | string | string | Removes HTML tags. `stripHtml(<p>Hello <b>world</b></p>)` -> `Hello world` |
| `trim(text)` | string | string | Removes whitespace from both ends. `trim(  hello  )` -> `hello` |
| `upper(text)` | string | string | Converts to uppercase. `upper(hello)` -> `HELLO` |

### Mathematics (5 functions)

| Function | Parameters | Return | Description |
|----------|-----------|--------|-------------|
| `add(values...)` | any[] (2-10) | string/number/array/object | Concatenates or adds. `add(5;10)` -> `15`, `add(hello;world)` -> `helloworld` |
| `divide(dividend;divisor)` | number, number | number | Divides first by second. `divide(10;2)` -> `5` |
| `multiply(values...)` | number[] (2-100) | number | Multiplies numbers. `multiply(5;3)` -> `15`, `multiply(2;3;4)` -> `24` |
| `round(value;decimals?)` | number, number? | number | Rounds to nearest integer or decimal places. `round(4.333;2)` -> `4.33` |
| `subtract(minuend;subtrahend)` | number, number | number | Subtracts second from first. `subtract(10;3)` -> `7` |

### Logic & Comparison (12 functions)

| Function | Parameters | Return | Description |
|----------|-----------|--------|-------------|
| `and(values...)` | any[] (2-100) | boolean | All values must be truthy. `and(true;false;true)` -> `false` |
| `boolean(value)` | any | boolean | 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` |
| `equals(value1;value2)` | any, any | boolean | Deep equality with strict types. `equals(5;5)` -> `true`, `equals('5';5)` -> `false`, `equals([1,2];[1,2])` -> `true` |
| `gt(value1;value2)` | number/string, number/string | boolean | Greater than (numbers and dates). `gt(5;3)` -> `true` |
| `gte(value1;value2)` | number/string, number/string | boolean | Greater than or equal. `gte(5;5)` -> `true` |
| `if(conditions...;trueValue;falseValue)` | any[] (3-100) | any | Conditional with AND logic for multiple conditions. `if(true;yes;no)` -> `yes` |
| `lt(value1;value2)` | number/string, number/string | boolean | Less than. `lt(3;5)` -> `true` |
| `lte(value1;value2)` | number/string, number/string | boolean | Less than or equal. `lte(3;3)` -> `true` |
| `not(value)` | any | boolean | Logical NOT (JavaScript truthiness). `not(true)` -> `false`, `not(0)` -> `true` |
| `notEquals(value1;value2)` | any, any | boolean | Inequality with strict types. `notEquals(5;3)` -> `true` |
| `or(values...)` | any[] (2-100) | boolean | Any value truthy. `or(false;false;true)` -> `true` |
| `switch(input;key1;val1;key2;val2;...default)` | any (3-100) | any | Switch-case matching. `switch(apple;apple;fruit;car;vehicle;unknown)` -> `fruit` |

### Data Validation (5 functions)

| Function | Parameters | Return | Description |
|----------|-----------|--------|-------------|
| `isEmpty(value)` | any | boolean | Checks null, undefined, empty string/array/object. `isEmpty()` -> `true` |
| `isNotEmpty(value)` | any | boolean | Opposite of isEmpty. `isNotEmpty(hello)` -> `true` |
| `isNumber(value)` | any | boolean | Finite number check (excludes NaN, Infinity). `isNumber(123)` -> `true` |
| `isWeekend(date)` | string | boolean | Saturday or Sunday. `isWeekend(2023-01-07)` -> `true` |
| `useDefault(value;defaultValue)` | any, any | any | Returns default if first is empty. `useDefault(;fallback)` -> `fallback` |

### Date & Time (10 functions)

| Function | Parameters | Return | Description |
|----------|-----------|--------|-------------|
| `addDays(date;days)` | string, number | string | Adds days to date. `addDays(2023-01-01;5)` -> `2023-01-06T00:00:00.000Z` |
| `addMonths(date;months)` | string, number | string | Adds months. `addMonths(2023-01-15;3)` -> `2023-04-15T00:00:00.000Z` |
| `addYears(date;years)` | string, number | string | Adds years. `addYears(2023-01-15;2)` -> `2025-01-15T00:00:00.000Z` |
| `daysBetween(startDate;endDate)` | string, string | number | Days between dates. `daysBetween(2023-01-01;2023-01-06)` -> `5` |
| `formatDate(date;format)` | string, string | string | Formats date with locale or pattern. `formatDate(2023-12-25;fi-FI)` -> `25.12.2023` |
| `formatDateTime(date;format)` | string, string | string | Formats date+time. `formatDateTime(2023-12-25T14:30:00;fi-FI)` -> `25.12.2023 14:30` |
| `formatRelative(date;baseDate?;locale?)` | string, string?, string? | string | Relative formatting. `formatRelative(2023-01-01)` -> `yesterday` |
| `subtractDays(date;days)` | string, number | string | Subtracts days. `subtractDays(2023-01-06;5)` -> `2023-01-01T00:00:00.000Z` |
| `subtractMonths(date;months)` | string, number | string | Subtracts months. |
| `subtractYears(date;years)` | string, number | string | Subtracts years. |

### Data Manipulation (9 functions)

| Function | Parameters | Return | Description |
|----------|-----------|--------|-------------|
| `formatCurrency(locale;currency;amount)` | string, string, number | string | Currency formatting. `formatCurrency(fi-FI;EUR;1234.56)` -> `1 234,56 €` |
| `formatList(locale;style;type;items)` | string, string, string, array | string | Locale-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? | any | Nested property access. `get({"a":{"b":1}};a.b)` -> `1` |
| `join(array;delimiter)` | array, string | string | Joins array elements into a string with the given delimiter. `join(['a','b','c'];, )` -> `a, b, c` |
| `map(array;property)` | array, string | array | Extracts property from objects. `map([{"a":1},{"a":2}];a)` -> `[1,2]` |
| `sort(array;direction;locale?)` | array, string, string? | array | 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']` |
| `sortBy(array;key:dir;key:dir?;locale?)` | array, string, string?, string? | array | 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)` |
| `unique(array)` | array | array | Removes duplicates from primitive arrays. `unique([1,2,2,3])` -> `[1,2,3]` |
| `uniqueBy(array;key1;key2?)` | array, string, string? | array | Removes duplicate objects by key path(s). Supports dot notation and composite keys. `uniqueBy(list;id)`, `uniqueBy(list;firstName;lastName)` |
