Formula functions
Every function a formula can use: what it takes, what it gives back, and examples.
Functions do work inside a formula: round(total, 2), uppercase(name), count(tasks). Write the function's name, then what it works on in brackets, separated by commas. A name ending in ? can be left out. The whole language is in Formula language reference.
#How to read this page
Each table lists a function the way you write it, what it does, and what it gives back.
round(number, places?)takes a number and, if you like, how many decimal places. The words in brackets say what goes there; you put your own values or formulas in their place:round(total, 2).?after a word means you can leave that value out:round(total)rounds to a whole number....means as many values as you like:max(a, b, c).minandmaxalso take one list:max(scores).itis each item of the list, in turn, insidefilter,find,map,sort,anyandall:filter(tasks, !it.done).- Text values take anything and use it as it would print, so
uppercase(5)is fine. Number values must be numbers: turn typed text into one withnumber(…)first. - Dates are text like 2026-10-28 or 2026-10-28T14:30:00Z.
now(),today()and the date functions give back the second form, in UTC, andformatDatewrites one out for people to read. - Angles are in degrees, as the Rotation modifier takes them:
sin(90)is 1. Colors are text like'#5B6CFF', as the color picker writes them. - Examples use the sample data on the formula language page:
totalis 120,nameis "Sam",scoresis [70, 95, 82, 95],tasksis a list of three tasks, and so on. Results are written the way you'd write the value in a formula: text in quotes, lists in square brackets. Money, percentages, dates and times are shown for an iPad set to English (US), in New York time.
Functions go inside each other, and the inner one is worked out first. In the Formula sheet, tap a function to add it with its opening bracket.
#Worked examples
These come from apps like an invoice maker and a to-do list. Each builds on functions from the tables below.
Add up an invoice. items is a list of records, each with qty and rate:
currency(sum(map(items, it.qty * it.rate)))
map turns each line into its amount (1 × 1200 and 4 × 85 give 1200 and 340), sum adds them up (1540), and currency writes it as money, like $1,540.00, in the iPad's currency and the way its region writes money. Add a currency code to choose one: currency(…, 'EUR').
Count what's left to do. tasks is a list of records with a True / False field done:
count(filter(tasks, !it.done))
filter keeps the tasks that aren't done, and count says how many. In text: {count(filter(tasks, !it.done))} left.
Search a list. search is the variable a Text Field keeps:
filter(products, contains(it.title, search))
contains ignores capital letters, so "phone" finds "iPhone". While search is empty, every product matches, so the whole list shows. Link a Repeater's Data to this formula to show the results.
Newest first. history is a list of records with a Date & Time field date:
sort(history, it.date, true)
The second value says what to sort by, and true puts the largest first. Dates sort by their time, so the newest comes first. first(sort(history, it.date, true)) gives only the newest record.
A due date and the days left. dueDays is a Whole Number, like 14:
formatDate(addDays(today(), dueDays), 'long')
addDays counts forward from the start of today, and formatDate writes the date out in full, the way the iPad's region writes dates. For the days left until a date variable dueDate, use daysBetween(today(), dueDate): it's negative once the date has passed.
A percentage that can't divide by zero.
percent(count(tasks) == 0 ? 0 : count(filter(tasks, it.done)) / count(tasks), 0)
With 1 task done out of 3, it gives 33%. The ? : checks for an empty list first, because dividing by count(tasks) when it's 0 is an error ("Can't divide by zero."). The last value, 0, is how many decimal places percent shows.
#Numbers
| Function | What it does | Gives back |
|---|---|---|
round(number, places?) | Rounds to a number of decimal places (whole number if left out). | Number |
floor(number) | Rounds down. | Number |
ceil(number) | Rounds up. | Number |
abs(number) | Drops the minus sign. | Number |
min(values...) | The smallest of the numbers, or of a list. | Number |
max(values...) | The largest of the numbers, or of a list. | Number |
clamp(number, lowest, highest) | Keeps a number between two limits. | Number |
sqrt(number) | Square root. | Number |
power(base, exponent) | base to the power of exponent. | Number |
random(lowest, highest) | A random whole number between the two, inclusive. | Number |
sign(number) | -1 for a negative number, 1 for a positive one, 0 for 0. | Number |
trunc(number) | The whole number part, dropping the decimals: trunc(-3.7) is -3. | Number |
log(number, base?) | The logarithm: the power base must be raised to to give number. Base 10 if left out. | Number |
exp(number) | e raised to the number. | Number |
pi() | π, 3.14159… | Number |
sin(degrees) | The sine of an angle in degrees: with cos, places things around a circle. | Number |
cos(degrees) | The cosine of an angle in degrees. | Number |
tan(degrees) | The tangent of an angle in degrees. | Number |
atan2(y, x) | The angle in degrees from the center to the point x, y: -180 to 180. | Number |
#round(number, places?)
Rounds to a number of decimal places (whole number if left out).
Gives back: Number
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
number | The number to round. | Number | Yes |
places | How many decimal places to keep. | Number | No: 0, a whole number |
Examples
| Formula | Result |
|---|---|
round(total / 7, 2) | 17.14 |
round(2.5) | 3 |
round(-2.5) | -3 |
round(1.005, 2) | 1 |
round(1234.5, -2) | 1235 |
Good to know
- Halves round away from zero: 2.5 becomes 3, and -2.5 becomes -3.
placesis itself rounded to a whole number and kept between 0 and 15. A negativeplacescounts as 0, soroundcan't round to tens or hundreds.- Some decimals are stored a hair below what you typed, so
round(1.005, 2)gives1, not 1.01. - The answer is a number, so zeros at the end don't show:
round(2.5, 2)gives2.5. To show 2.50, usefixed. - Text isn't rounded, even when it looks like a number:
round(qtyText)is an error: “round needs a number, not text.” Useround(number(qtyText)).
#floor(number)
Rounds down.
Gives back: Number
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
number | The number to round down. | Number | Yes |
Examples
| Formula | Result |
|---|---|
floor(2.7) | 2 |
floor(-2.5) | -3 |
floor(total / 7) | 17 |
floor(qtyText) | Error: floor needs a number, not text. |
Good to know
- It always goes to the whole number below, so negative numbers move away from zero.
- A whole number stays as it is:
floor(5)gives5.
#ceil(number)
Rounds up.
Gives back: Number
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
number | The number to round up. | Number | Yes |
Examples
| Formula | Result |
|---|---|
ceil(2.1) | 3 |
ceil(-2.5) | -2 |
ceil(people / 2) | 2 |
ceil(5) | 5 |
Good to know
- It always goes to the whole number above, so negative numbers move toward zero.
- Handy for counting whole things: tables of 2 for 3 people is
ceil(people / 2).
#abs(number)
Drops the minus sign.
Gives back: Number
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
number | Any number. | Number | Yes |
Examples
| Formula | Result |
|---|---|
abs(-4) | 4 |
abs(4) | 4 |
abs(total - 150) | 30 |
abs(coupon) | Error: abs needs a number, not null. |
Good to know
- Use it for the size of a difference, whichever way round:
abs(total - 150).
#min(values...)
The smallest of the numbers, or of a list.
Gives back: Number
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
values... | Numbers separated by commas, or one list of numbers. | Numbers, or a list | Yes: at least one |
Examples
| Formula | Result |
|---|---|
min(3, 1, 2) | 1 |
min(scores) | 70 |
min([]) | null |
min(scores, 50) | Error: min needs numbers, not a list. |
min() | Error: min(values...) can't take 0 arguments. |
Good to know
- Give it numbers or one list, not both. To include another number, put it in a list:
min([50, min(scores)]). - An empty list gives
null. - Text is an error, even text that looks like a number:
min(['3', 2])is an error: “min needs numbers, not text.” - One number on its own gives that number:
min(5)gives5.
#max(values...)
The largest of the numbers, or of a list.
Gives back: Number
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
values... | Numbers separated by commas, or one list of numbers. | Numbers, or a list | Yes: at least one |
Examples
| Formula | Result |
|---|---|
max(scores) | 95 |
max(total, 100) | 120 |
max(0, total - 200) | 0 |
max([]) | null |
max(['3', 2]) | Error: max needs numbers, not text. |
Good to know
- Give it numbers or one list, not both.
- An empty list gives
null. max(0, x)keeps a result from going below zero.
#clamp(number, lowest, highest)
Keeps a number between two limits.
Gives back: Number
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
number | The number to keep in range. | Number | Yes |
lowest | The smallest it may be. | Number | Yes |
highest | The largest it may be. | Number | Yes |
Examples
| Formula | Result |
|---|---|
clamp(15, 0, 10) | 10 |
clamp(-5, 0, 10) | 0 |
clamp(7, 0, 10) | 7 |
clamp(5, 10, 0) | 0 |
Good to know
- Put
lowestfirst. Iflowestis bigger thanhighest, the answer is alwayshighest. - Good for keeping a typed value inside limits:
clamp(number(qtyText) ?? 1, 1, 99)gives3.
#sqrt(number)
Square root.
Gives back: Number
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
number | The number to take the square root of. | Number | Yes |
Examples
| Formula | Result |
|---|---|
sqrt(16) | 4 |
sqrt(2) | 1.4142135623730951 |
sqrt(0) | 0 |
sqrt(-1) | nan |
Good to know
- A negative number has no square root, so the answer is “nan” (not a number). It prints as nan, and any math with it gives nan too. Check first:
x >= 0 ? sqrt(x) : 0.
#power(base, exponent)
base to the power of exponent.
Gives back: Number
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
base | The number to multiply by itself. | Number | Yes |
exponent | How many times. Negative and decimal exponents work too. | Number | Yes |
Examples
| Formula | Result |
|---|---|
power(2, 10) | 1024 |
power(2, -1) | 0.5 |
power(9, 0.5) | 3 |
power(10, 16) | 1e+16 |
power(-8, 1 / 3) | nan |
Good to know
- A negative base with a decimal exponent gives “nan” (not a number).
- Very big answers print in short form:
power(10, 16)gives1e+16. - Formulas have no
^or**operator: usepower.
#random(lowest, highest)
A random whole number between the two, inclusive.
Gives back: Number
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
lowest | The smallest number it may give. | Number | Yes |
highest | The largest number it may give. | Number | Yes |
Examples
| Formula | Result |
|---|---|
random(1, 6) | For example 4: any whole number from 1 to 6 |
random(5, 5) | 5 |
random(1.5, 3.5) | For example 2: 2 or 3 |
random(6, 1) | Error: random needs two whole numbers, the lowest first. |
Good to know
- Both ends can come up.
- Decimals are rounded inward:
lowestup andhighestdown. If nothing whole is left between them, likerandom(0.2, 0.8), it's an error. - It gives a new number each time the formula is worked out. To keep one, save it in a variable with a Set Value step.
#sign(number)
-1 for a negative number, 1 for a positive one, 0 for 0.
Gives back: Number
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
number | Any number. | Number | Yes |
Examples
| Formula | Result |
|---|---|
sign(-12) | -1 |
sign(total) | 1 |
sign(0) | 0 |
sign(name) | Error: sign needs a number, not text. |
Good to know
- With
abs, it splits a change into how much and which way:abs(change)andsign(change).
#trunc(number)
The whole number part, dropping the decimals: trunc(-3.7) is -3.
Gives back: Number
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
number | Any number. | Number | Yes |
Examples
| Formula | Result |
|---|---|
trunc(3.7) | 3 |
trunc(-3.7) | -3 |
trunc(total / 7) | 17 |
trunc(qtyText) | Error: trunc needs a number, not text. |
Good to know
- It goes toward 0, where
floorgoes down:floor(-3.7)gives-4.
#log(number, base?)
The logarithm: the power base must be raised to to give number. Base 10 if left out.
Gives back: Number
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
number | A number above 0. | Number | Yes |
base | The base: 10 if left out, 2 for doubling, exp(1) for e. | Number | No: 10 |
Examples
| Formula | Result |
|---|---|
log(1000) | 3 |
log(8, 2) | 3 |
log(total) | 2.079181246048 |
log(0) | Error: log needs a number above 0, and a base above 0 that isn't 1. |
Good to know
- It answers "how many times":
log(1024, 2)gives10, the number of doublings from 1 to 1024. - Answers are rounded to 12 decimal places, so
log(1000)is exactly 3.
#exp(number)
e raised to the number.
Gives back: Number
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
number | The power to raise e (2.71828…) to. | Number | Yes |
Examples
| Formula | Result |
|---|---|
exp(0) | 1 |
exp(1) | 2.718281828459 |
round(exp(2), 2) | 7.39 |
exp(name) | Error: exp needs a number, not text. |
Good to know
- Answers are rounded to 12 decimal places.
- For growth:
start * exp(rate * years)is continuous compound growth.
#pi()
π, 3.14159…
Gives back: Number
Takes nothing: write the brackets with nothing between them.
Examples
| Formula | Result |
|---|---|
pi() | 3.141592653589793 |
round(pi(), 2) | 3.14 |
2 * pi() * 10 | 62.83185307179586 |
pi(2) | Error: pi() can't take 1 argument. |
Good to know
- A circle's length around is
2 * pi() * radius, and its areapi() * power(radius, 2).
#sin(degrees)
The sine of an angle in degrees: with cos, places things around a circle.
Gives back: Number
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
degrees | An angle in degrees: 90 is a quarter turn. | Number | Yes |
Examples
| Formula | Result |
|---|---|
sin(30) | 0.5 |
sin(90) | 1 |
sin(180) | 0 |
sin(name) | Error: sin needs a number, not text. |
Good to know
- It takes degrees, as the Rotation modifier does, not radians.
- To put something on a circle, as a clock's numbers are, give it an Offset of
sin(angle) * radiusacross and-cos(angle) * radiusdown: angle 0 is at the top, and it goes round clockwise. - Answers are rounded to 12 decimal places, so
sin(30)is exactly 0.5.
#cos(degrees)
The cosine of an angle in degrees.
Gives back: Number
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
degrees | An angle in degrees: 90 is a quarter turn. | Number | Yes |
Examples
| Formula | Result |
|---|---|
cos(0) | 1 |
cos(60) | 0.5 |
cos(90) | 0 |
cos(180) | -1 |
Good to know
- It takes degrees. With
sin, it places things around a circle: seesin.
#tan(degrees)
The tangent of an angle in degrees.
Gives back: Number
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
degrees | An angle in degrees: 90 is a quarter turn. | Number | Yes |
Examples
| Formula | Result |
|---|---|
tan(45) | 1 |
tan(0) | 0 |
round(tan(60), 3) | 1.732 |
Good to know
- It takes degrees. Near 90 it gets very large.
#atan2(y, x)
The angle in degrees from the center to the point x, y: -180 to 180.
Gives back: Number
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
y | How far down (or up, with a minus) the point is from the center. | Number | Yes |
x | How far right (or left, with a minus). | Number | Yes |
Examples
| Formula | Result |
|---|---|
atan2(1, 1) | 45 |
atan2(1, 0) | 90 |
atan2(0, -1) | 180 |
atan2(-1, 0) | -90 |
Good to know
- It gives the angle of a point in degrees, from -180 to 180, the opposite of
sinandcos.
#Text
| Function | What it does | Gives back |
|---|---|---|
uppercase(text) | ALL CAPS. | Text |
lowercase(text) | all lowercase. | Text |
trim(text) | Removes spaces and new lines at both ends. | Text |
contains(textOrList, value) | Whether text contains other text (ignoring case), or a list contains a value. | Bool |
startsWith(text, prefix) | Whether text starts with other text. | Bool |
endsWith(text, suffix) | Whether text ends with other text. | Bool |
slice(listOrText, start, end?) | Part of a list or text, from start up to end (not included). A minus counts from the end. | Any |
indexOf(listOrText, value) | Where a value first is in a list, or text in text (ignoring case), counting from 0; null if it isn't there. | Number |
padStart(value, length, padding?) | The value as text, with padding (a space if left out) in front until it's length long: padStart(5, 2, '0') is "05". | Text |
capitalize(text) | Text With Every Word Capitalized. | Text |
repeat(text, times) | Text repeated a number of times. | Text |
reverse(listOrText) | A list or text, back to front. | Any |
matches(text, pattern) | Whether text matches a pattern (a regular expression) anywhere in it. | Bool |
urlEncode(text) | Text made safe for a web address, like a search in a Call API's URL. | Text |
replace(text, find, replacement) | Replaces every occurrence. | Text |
split(text, separator) | Cuts text into a list at every separator. | List |
join(list, separator?) | Joins a list into text, with a separator between items. | Text |
number(text) | Reads a number from text; null if it isn't one. | Number |
text(value) | Any value as text. | Text |
#uppercase(text)
ALL CAPS.
Gives back: Text
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
text | The text to change. Any value works, used as it prints. | Text | Yes |
Examples
| Formula | Result |
|---|---|
uppercase(name) | "SAM" |
uppercase('straße') | "STRASSE" |
uppercase(5) | "5" |
uppercase(coupon) | "" |
Good to know
nullgives empty text.- Letters from every language change, and some change to more than one letter, like ß to SS.
#lowercase(text)
all lowercase.
Gives back: Text
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
text | The text to change. Any value works, used as it prints. | Text | Yes |
Examples
| Formula | Result |
|---|---|
lowercase('Hello World') | "hello world" |
lowercase(user.name) | "ada" |
lowercase(isMember) | "true" |
lowercase(coupon) | "" |
Good to know
- To compare text without caring about capital letters, lowercase both sides:
lowercase(name) == 'sam'givestrue.
#trim(text)
Removes spaces and new lines at both ends.
Gives back: Text
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
text | The text to tidy. Any value works, used as it prints. | Text | Yes |
Examples
| Formula | Result |
|---|---|
trim(' Sam ') | "Sam" |
trim(' two words ') | "two words" |
isEmpty(trim(' ')) | true |
trim(42) | "42" |
Good to know
- It removes spaces, tabs and new lines at both ends, never in the middle.
- Use it before checking a Text Field for something typed:
isEmpty(trim(name)), so a few spaces don't count.
#contains(textOrList, value)
Whether text contains other text (ignoring case), or a list contains a value.
Gives back: Bool
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
textOrList | The text or the list to look in. | Text, or a list | Yes |
value | What to look for. | Any value | Yes |
Examples
| Formula | Result |
|---|---|
contains('Grocery list', 'LIST') | true |
contains(scores, 82) | true |
contains(scores, '82') | false |
contains(name, '') | true |
contains(map(tasks, it.title), 'Pay rent') | true |
Good to know
- In text, capital letters don't matter. In a list, the item must be equal, kind and capitals included, so the text '82' isn't in a list of numbers.
- Empty text is in every text. So a search with nothing typed yet,
filter(tasks, contains(it.title, search)), keeps every item. - Anything that isn't a list is searched as it prints:
contains(1234, 23)givestrue, andcontains(coupon, 'x')givesfalse.
#startsWith(text, prefix)
Whether text starts with other text.
Gives back: Bool
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
text | The text to check. Any value works, used as it prints. | Text | Yes |
prefix | What it should start with. | Text | Yes |
Examples
| Formula | Result |
|---|---|
startsWith('PadCode', 'Pad') | true |
startsWith('PadCode', 'pad') | false |
startsWith(startDate, '2026-10') | true |
startsWith(name, '') | true |
Good to know
- Unlike
contains, capital letters matter. To ignore them, lowercase both:startsWith(lowercase(name), 's')givestrue. - Every text starts with empty text.
#endsWith(text, suffix)
Whether text ends with other text.
Gives back: Bool
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
text | The text to look at. | Text | Yes |
suffix | The text it might end with. | Text | Yes |
Examples
| Formula | Result |
|---|---|
endsWith(name, 'am') | true |
endsWith('photo.png', '.png') | true |
endsWith(name, 'AM') | false |
endsWith(total, 0) | true |
Good to know
- Capital letters count. To ignore them, lowercase both:
endsWith(lowercase(name), 'am')givestrue.
#slice(listOrText, start, end?)
Part of a list or text, from start up to end (not included). A minus counts from the end.
Gives back: Any
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
listOrText | A list, or text. | List or Text | Yes |
start | Where to start, counting from 0. A minus counts from the end. | Number | Yes |
end | Where to stop: that item isn't included. The end if left out. | Number | No: the end |
Examples
| Formula | Result |
|---|---|
slice(scores, 1, 3) | [95, 82] |
slice(scores, -2) | [82, 95] |
slice(name, 0, 2) | "Sa" |
slice('PadCode', 3) | "Code" |
slice(scores, 3, 1) | [] |
slice(total, 1) | Error: slice needs a list or text, not a number. |
Good to know
- The first three:
slice(scores, 0, 3). The last three:slice(scores, -3). - Past either end is fine: it stops at the end.
#indexOf(listOrText, value)
Where a value first is in a list, or text in text (ignoring case), counting from 0; null if it isn't there.
Gives back: Number
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
listOrText | A list, or text. | List or Text | Yes |
value | What to look for. | Any | Yes |
Examples
| Formula | Result |
|---|---|
indexOf(scores, 95) | 1 |
indexOf(scores, 100) | null |
indexOf(name, 'm') | 2 |
indexOf('Hello', 'L') | 2 |
indexOf(total, 2) | Error: indexOf needs a list or text, not a number. |
Good to know
- It counts from 0, as
list[0]does. Text is found ignoring capital letters. - Only the first is found:
indexOf(scores, 95)is 1, not 3.
#padStart(value, length, padding?)
The value as text, with padding (a space if left out) in front until it's length long: padStart(5, 2, '0') is "05".
Gives back: Text
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
value | Any value, as it prints. | Text | Yes |
length | How long the text should be. | Number | Yes |
padding | What goes in front: a space if left out. | Text | No: ' ' |
Examples
| Formula | Result |
|---|---|
padStart(5, 2, '0') | "05" |
padStart(people, 3, '0') | "003" |
padStart(name, 5) | " Sam" |
padStart('12345', 3, '0') | "12345" |
padStart(7, 3, '') | Error: padStart's padding can't be empty. |
Good to know
- Text already that long stays as it is.
- A digital clock:
padStart(hour(now()), 2, '0') + ':' + padStart(minute(now()), 2, '0'), orformatDate(now(), 'HH:mm').
#capitalize(text)
Text With Every Word Capitalized.
Gives back: Text
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
text | Any text. | Text | Yes |
Examples
| Formula | Result |
|---|---|
capitalize('hello world') | "Hello World" |
capitalize(name) | "Sam" |
capitalize('ADA LOVELACE') | "Ada Lovelace" |
capitalize(people) | "3" |
Good to know
- Each word starts with a capital, and its other letters are made small.
#repeat(text, times)
Text repeated a number of times.
Gives back: Text
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
text | The text to repeat. | Text | Yes |
times | How many times: 0 to 10,000. | Number | Yes |
Examples
| Formula | Result |
|---|---|
repeat('★', 3) | "★★★" |
repeat('★', people) + repeat('☆', 5 - people) | "★★★☆☆" |
repeat('ab', 0) | "" |
repeat('★', -1) | Error: repeat needs a whole number of times, from 0 to 10,000. |
Good to know
- A rating out of five, as stars, is the second example.
#reverse(listOrText)
A list or text, back to front.
Gives back: Any
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
listOrText | A list, or text. | List or Text | Yes |
Examples
| Formula | Result |
|---|---|
reverse(scores) | [95, 82, 95, 70] |
reverse(name) | "maS" |
reverse(total) | Error: reverse needs a list or text, not a number. |
Good to know
- Newest first, for a list kept oldest first:
reverse(history).
#matches(text, pattern)
Whether text matches a pattern (a regular expression) anywhere in it.
Gives back: Bool
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
text | The text to look at. | Text | Yes |
pattern | A regular expression, like '[0-9]+' for digits. | Text | Yes |
Examples
| Formula | Result |
|---|---|
matches(name, '^S') | true |
matches('abc123', '[0-9]+') | true |
matches(name, '^s') | false |
matches(name, '[') | Error: matches can't read the pattern [. |
Good to know
- It's true when the pattern is found anywhere. To match the whole text, start it with
^and end it with$. - Capital letters count.
#urlEncode(text)
Text made safe for a web address, like a search in a Call API's URL.
Gives back: Text
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
text | Any text. | Text | Yes |
Examples
| Formula | Result |
|---|---|
urlEncode('coffee & cake') | "coffee%20%26%20cake" |
'https://example.com/search?q=' + urlEncode(name) | "https://example.com/search?q=Sam" |
urlEncode('a/b?c=d') | "a%2Fb%3Fc%3Dd" |
Good to know
- Use it for anything typed that goes in a Call API's web address, so a space or an & doesn't break it.
#replace(text, find, replacement)
Replaces every occurrence.
Gives back: Text
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
text | The text to change. Any value works, used as it prints. | Text | Yes |
find | The text to look for. | Text | Yes |
replacement | What to put in its place. Empty text removes it. | Text | Yes |
Examples
| Formula | Result |
|---|---|
replace('a-b-c', '-', '+') | "a+b+c" |
replace('Hello', 'L', 'x') | "Hello" |
replace(name, 'Sam', 'Ada') | "Ada" |
replace('1,234', ',', '') | "1234" |
replace('abc', '', 'x') | "abc" |
Good to know
- It replaces every match, and capital letters matter.
- Empty
findtext changes nothing. - The answer is text, even when it looks like a number:
number(replace('1,234', ',', ''))gives1234.
#split(text, separator)
Cuts text into a list at every separator.
Gives back: List
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
text | The text to cut up. Any value works, used as it prints. | Text | Yes |
separator | The text to cut at. It isn't kept. | Text | Yes |
Examples
| Formula | Result |
|---|---|
split('a,b,c', ',') | ["a", "b", "c"] |
split('a, b', ',') | ["a", " b"] |
count(split('one two three', ' ')) | 3 |
split('', ',') | [""] |
split('abc', '') | ["abc"] |
Good to know
- Spaces next to the separator stay with the pieces. Cut at
', 'to drop them, ortrimeach piece:map(split('a, b', ','), trim(it))gives["a", "b"]. - Empty text gives a list with one empty text in it, so its
countis 1, not 0. - The separator must match exactly, capital letters included. Empty separator text doesn't cut anything.
#join(list, separator?)
Joins a list into text, with a separator between items.
Gives back: Text
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
list | The list to join. | List | Yes |
separator | What to put between the items. | Text | No: a comma and a space |
Examples
| Formula | Result |
|---|---|
join(['a', 'b']) | "a, b" |
join(scores, ' + ') | "70 + 95 + 82 + 95" |
join(map(tasks, it.title), ' · ') | "Call Sam · Buy milk · Pay rent" |
join([]) | "" |
join(name) | Error: join needs a list, not text. |
Good to know
- Each item is used as it prints, so numbers lose
.0andnullitems print as nothing. - An empty list gives empty text.
#number(text)
Reads a number from text; null if it isn't one.
Gives back: Number
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
text | The text to read, like what's typed in a Text Field. A number works too. | Text | Yes |
Examples
| Formula | Result |
|---|---|
number(qtyText) + 1 | 4 |
number(' 42.5 ') | 42.5 |
number('1,000') | null |
number('lots') ?? 0 | 0 |
number(7) | 7 |
Good to know
- It reads digits with a dot for decimals, and an optional minus. Spaces around the number are fine.
- Commas aren't read, as thousands separators or as decimal commas:
number('3,5')givesnull. Remove them first withreplace. - It gives
null, not an error, when the text isn't a number, so add a fallback with??. - True and false aren't numbers:
number(isMember)givesnull. - A number in short form is read too:
number('1e3')gives1000.
#text(value)
Any value as text.
Gives back: Text
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
value | Any value. | Any value | Yes |
Examples
| Formula | Result |
|---|---|
text(3.50) | "3.5" |
text(isMember) | "true" |
text(coupon) | "" |
text(scores) | "70, 95, 82, 95" |
text(people) + text(people) | "33" |
Good to know
- It gives the value as it prints in text with braces: whole numbers without
.0,nullas empty text, a list with commas, a record in braces and quotes. +already joins text with anything, so you needtextmainly to join two numbers as text, or to compare:text(people) == '3'givestrue.
#Formatting
| Function | What it does | Gives back |
|---|---|---|
currency(number, code?) | Money, like $37.88. code is a currency code like "EUR"; the iPad's currency if left out. | Text |
percent(number, places?) | 0.18 as 18%. | Text |
fixed(number, places) | A number with exactly that many decimals: 3.50. | Text |
compactNumber(number) | A number made short: 1.2K, 3.4M. | Text |
ordinal(number) | A number as a position: 1st, 2nd, 3rd. | Text |
plural(count, singular, plural?) | A count with its word, singular or plural: 1 coffee, 3 coffees. | Text |
formatDuration(seconds, style?) | Seconds as a time span. style: clock ("1:02:05", the default), short ("1h 2m 5s") or long. | Text |
formatDate(date, style?) | A date as text. style: short, medium (default), long, time, relative ("in 2 days"), weekday ("Wednesday"), month ("October") or a pattern like 'HH:mm'. | Text |
#currency(number, code?)
Money, like $37.88. code is a currency code like "EUR"; the iPad's currency if left out.
Gives back: Text
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
number | The amount. | Number | Yes |
code | A three-letter currency code, like 'EUR' or 'JPY'. | Text | No: the iPad's currency |
Examples
| Formula | Result |
|---|---|
currency(37.88) | "$37.88" |
currency(sum(map(items, it.qty * it.rate))) | "$1,540.00" |
currency(37.88, 'EUR') | "€37.88" |
currency(-5) | "-$5.00" |
currency(qtyText) | Error: currency needs a number, not text. |
Good to know
- It writes money the way the iPad's region does: the symbol, where it goes, and the separators. The code only picks the currency.
- It rounds to the currency's own decimal places. When the amount is exactly halfway, it rounds to the even digit:
currency(1540.5, 'JPY')gives"¥1,540". - The answer is text, for showing. Do math on the number, then format it last.
#percent(number, places?)
0.18 as 18%.
Gives back: Text
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
number | A fraction: 0.18 for 18%. | Number | Yes |
places | Exactly how many decimal places to show. | Number | No: as many as needed, up to 6 |
Examples
| Formula | Result |
|---|---|
percent(0.18) | "18%" |
percent(0.1856, 1) | "18.6%" |
percent(1 / 3) | "33.333333%" |
percent(18) | "1,800%" |
percent(0.125, 0) | "12%" |
Good to know
- Give it a fraction:
percent(18)is 1,800%. Divide by 100 first if you have a whole percentage. - When the value is exactly halfway, it rounds to the even digit:
percent(0.125, 0)gives"12%", andpercent(0.375, 0)gives"38%". - The answer is text, written the way the iPad's region writes percentages.
#fixed(number, places)
A number with exactly that many decimals: 3.50.
Gives back: Text
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
number | The number to show. | Number | Yes |
places | Exactly how many decimal places to show, 0 to 15. | Number | Yes |
Examples
| Formula | Result |
|---|---|
fixed(3.5, 2) | "3.50" |
fixed(1234.5, 2) | "1,234.50" |
fixed(total / 7, 3) | "17.143" |
fixed(2.5, 0) | "2" |
fixed(3.5, 0) | "4" |
Good to know
- When the value is exactly halfway, it rounds to the even digit, unlike
round:fixed(2.5, 0)gives"2", butround(2.5)gives3. - It adds the region's thousands separators, and uses its decimal point.
- The answer is text, for showing. To keep a number, use
round.
#compactNumber(number)
A number made short: 1.2K, 3.4M.
Gives back: Text
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
number | Any number. | Number | Yes |
Examples
| Formula | Result |
|---|---|
compactNumber(1234) | "1.2K" |
compactNumber(1500000) | "1.5M" |
compactNumber(total) | "120" |
compactNumber(name) | Error: compactNumber needs a number, not text. |
Good to know
- It's in the iPad's language and region, so it fits where space is short, like a widget.
#ordinal(number)
A number as a position: 1st, 2nd, 3rd.
Gives back: Text
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
number | A whole number. | Number | Yes |
Examples
| Formula | Result |
|---|---|
ordinal(1) | "1st" |
ordinal(people) | "3rd" |
ordinal(22) | "22nd" |
ordinal(11) | "11th" |
Good to know
- It's in the iPad's language: a place in a race, a day of the month.
#plural(count, singular, plural?)
A count with its word, singular or plural: 1 coffee, 3 coffees.
Gives back: Text
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
count | How many. | Number | Yes |
singular | The word for one. | Text | Yes |
plural | The word for any other number: singular with an s if left out. | Text | No |
Examples
| Formula | Result |
|---|---|
plural(1, 'coffee') | "1 coffee" |
plural(people, 'coffee') | "3 coffees" |
plural(2, 'person', 'people') | "2 people" |
plural(0, 'task') | "0 tasks" |
plural(count(tasks), 'task') | "3 tasks" |
Good to know
- Only exactly 1 takes the singular.
#formatDuration(seconds, style?)
Seconds as a time span. style: clock ("1:02:05", the default), short ("1h 2m 5s") or long.
Gives back: Text
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
seconds | How many seconds. A minus puts a minus in front. | Number | Yes |
style | 'clock', 'short' or 'long'. | Text | No: 'clock' |
Examples
| Formula | Result |
|---|---|
formatDuration(90) | "1:30" |
formatDuration(3725) | "1:02:05" |
formatDuration(-90) | "-1:30" |
formatDuration(3725, 'short') | "1h 2m 5s" |
formatDuration(3725, 'long') | "1 hour, 2 minutes, 5 seconds" |
formatDuration(90, 'days') | Error: formatDuration's style is clock, short or long, not days. |
Good to know
- A countdown:
formatDuration(secondsBetween(now(), endTime)). 'short'and'long'are in the iPad's language.
#formatDate(date, style?)
A date as text. style: short, medium (default), long, time, relative ("in 2 days"), weekday ("Wednesday"), month ("October") or a pattern like 'HH:mm'.
Gives back: Text
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
date | A date, in a form the date functions read. | Date | Yes |
style | 'short', 'medium', 'long', 'time', 'relative', 'weekday', 'month', or a pattern of date letters like 'HH:mm'. | Text | No: 'medium' |
Examples
| Formula | Result |
|---|---|
formatDate(startDate) | "Oct 28, 2026" |
formatDate(startDate, 'short') | "10/28/2026" |
formatDate(startDate, 'long') | "October 28, 2026" |
formatDate(startDate, 'time') | "10:30 AM" |
formatDate(startDate, 'weekday') | "Wednesday" |
formatDate(startDate, 'month') | "October" |
formatDate(startDate, 'HH:mm') | "10:30" |
formatDate(startDate, 'EEE d MMM') | "Wed 28 Oct" |
formatDate(startDate, 'yyyy') | "2026" |
formatDate(startDate, 'full') | Error: formatDate's style is short, medium, long, time, relative, weekday, month or a pattern like 'HH:mm', not full. |
Good to know
- It writes the date in the iPad's language, region and time zone. 2:30 PM UTC is 10:30 AM in New York, and a time early in the UTC day is still the day before there:
formatDate('2026-10-28T02:00:00Z')gives"Oct 27, 2026". 'relative'says how far it is from now, in words:formatDate(addDays(now(), 2), 'relative')gives"in 2 days", andformatDate(addDays(now(), -1), 'relative')gives"yesterday".- A plain day like
'2026-10-28'is midnight where the iPad is:formatDate('2026-10-28', 'time')gives"12:00 AM". - Something that isn't a date is an error:
formatDate('soon')is an error: “formatDate needs a date like '2026-10-28', not 'soon'.” - A pattern spells the date with letters:
yyyythe year,MMMMthe month's name (MMMshort,MMits number),dthe day,EEEEthe weekday (EEEshort),HHthe hour from 0 to 23 (hfrom 1 to 12, withafor AM or PM),mmminutes andssseconds. Anything else, like a space, a colon or a comma, stays as it is.
#Dates and times
| Function | What it does | Gives back |
|---|---|---|
now() | This moment. | Date |
today() | The start of today. | Date |
date(text) | Reads a date from text like "2026-10-28", or from seconds since 1970. | Date |
addDays(date, days) | A date some days later (or earlier, with a minus). | Date |
addMinutes(date, minutes) | A date some minutes later. | Date |
daysBetween(start, end) | Whole days from start to end. | Number |
hour(date) | The hour of a date, 0 to 23, where the iPad is. | Number |
minute(date) | The minute of a date, 0 to 59. | Number |
second(date) | The second of a date, 0 to 59. | Number |
day(date) | The day of the month, 1 to 31. | Number |
month(date) | The month of a date, 1 (January) to 12. | Number |
year(date) | The year of a date. | Number |
weekday(date) | The day of the week, 1 (Sunday) to 7 (Saturday). | Number |
timestamp(date) | A date as seconds since 1970, as many web APIs write it. | Number |
addMonths(date, months) | A date some months later (or earlier, with a minus), on the same day where it can be. | Date |
startOf(date, unit) | The start of the date's day, week, month or year. | Date |
secondsBetween(start, end) | Whole seconds from start to end. | Number |
minutesBetween(start, end) | Whole minutes from start to end. | Number |
hoursBetween(start, end) | Whole hours from start to end. | Number |
monthsBetween(start, end) | Whole months from start to end. | Number |
yearsBetween(start, end) | Whole years from start to end: someone's age from their birthday. | Number |
#now()
This moment.
Gives back: Date
Takes nothing: write the brackets with nothing between them.
Examples
| Formula | Result |
|---|---|
now() | For example "2026-10-31T13:41:07Z" |
now() > startDate | true |
addMinutes(now(), 30) > now() | true |
now(1) | Error: now() can't take 1 argument. |
Good to know
- It's in UTC, to the second, in the form on Dates and times.
- It's worked out again each time the formula is, so it's the moment the formula ran. To keep a moment, like when something was added, save it with a Set Value step.
- To show it to people, use
formatDate(now(), 'time').
#today()
The start of today.
Gives back: Date
Takes nothing: write the brackets with nothing between them.
Examples
| Formula | Result |
|---|---|
today() | For example "2026-10-31T04:00:00Z": midnight in New York |
today() <= now() | true |
formatDate(today(), 'time') | "12:00 AM" |
daysBetween(today(), now()) | 0 |
Good to know
- It's midnight at the start of today in the iPad's time zone, written in UTC. So in New York in late October, it ends in T04:00:00Z.
- Add days to it for a due date:
addDays(today(), 14).
#date(text)
Reads a date from text like "2026-10-28", or from seconds since 1970.
Gives back: Date
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
text | Text holding a date, like '2026-10-28' or '2026-10-28T14:30:00Z'; or a number of seconds since 1970, as many web APIs write dates. | Text or Number | Yes |
Examples
| Formula | Result |
|---|---|
date('2026-10-28') | "2026-10-28T04:00:00Z" |
date('2026-10-28T16:30:00+02:00') | "2026-10-28T14:30:00Z" |
date('2026-10-28T14:30:00.250Z') | "2026-10-28T14:30:00Z" |
date('10/28/2026') | null |
date('2026-10-28 14:30') | null |
date(1793197800) | "2026-10-28T14:30:00Z" |
date(1793197800000) | "2026-10-28T14:30:00Z" |
date(0) | "1970-01-01T00:00:00Z" |
Good to know
- It reads the forms on Dates and times and gives the date in UTC, ending in Z. Anything else gives
null, not an error. - A plain day is midnight in the iPad's time zone: in New York,
'2026-10-28'becomes 4 AM UTC. - Use it to compare dates written in different forms:
date('2026-10-28T16:30:00+02:00') == startDategivestrue. - A number is seconds since the start of 1970 in UTC. A number too big for that, like 1793197800000, is read as milliseconds, which some APIs send.
timestamp(…)turns a date back into seconds.
#addDays(date, days)
A date some days later (or earlier, with a minus).
Gives back: Date
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
date | The date to count from. | Date | Yes |
days | How many days to add. Use a minus to go back. | Number | Yes |
Examples
| Formula | Result |
|---|---|
addDays(startDate, 2) | "2026-10-30T14:30:00Z" |
addDays(startDate, -1) | "2026-10-27T14:30:00Z" |
addDays('2026-10-28', 7) | "2026-11-04T05:00:00Z" |
addDays(startDate, 1.5) | "2026-10-30T14:30:00Z" |
addDays('soon', 1) | Error: addDays needs a date like '2026-10-28', not 'soon'. |
Good to know
daysis rounded to the nearest whole number, so 1.5 adds 2 days. For hours, useaddMinutes.- It keeps the time on the iPad's clock. Across a change to or from daylight saving time, the time in UTC moves by an hour: in New York, a week after midnight on October 28 is midnight on November 4, which is 05:00 UTC instead of 04:00.
- It always gives a date and time in UTC, ending in Z, even from a plain day.
#addMinutes(date, minutes)
A date some minutes later.
Gives back: Date
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
date | The date to count from. | Date | Yes |
minutes | How many minutes to add. Use a minus to go back; decimals add seconds. | Number | Yes |
Examples
| Formula | Result |
|---|---|
addMinutes(startDate, 90) | "2026-10-28T16:00:00Z" |
addMinutes(startDate, -30) | "2026-10-28T14:00:00Z" |
addMinutes(startDate, 1.5) | "2026-10-28T14:31:30Z" |
addMinutes(startDate, 60 * 24 * 7) | "2026-11-04T14:30:00Z" |
addMinutes(startDate, '5') | Error: addMinutes needs a number, not text. |
Good to know
- It adds exact minutes, whatever the time zone or daylight saving time, so a week of minutes can land on a different clock time than
addDays(startDate, 7). - For hours, multiply:
addMinutes(startDate, 2 * 60).
#daysBetween(start, end)
Whole days from start to end.
Gives back: Number
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
start | The first date. | Date | Yes |
end | The second date. | Date | Yes |
Examples
| Formula | Result |
|---|---|
daysBetween('2026-10-28', '2026-11-02') | 5 |
daysBetween('2026-11-02', '2026-10-28') | -5 |
daysBetween(startDate, '2026-10-28T23:00:00Z') | 0 |
daysBetween('2026-10-28T23:00:00Z', '2026-10-29T01:00:00Z') | 0 |
daysBetween(startDate, 'soon') | Error: daysBetween needs a date like '2026-10-28', not 'soon'. |
Good to know
- It counts calendar days in the iPad's time zone: how many midnights from
starttoend. The time of day doesn't matter. - Two times on different days in UTC can be the same day where the iPad is: 11 PM and 1 AM UTC are both on October 28 in New York, so the answer is 0.
- It's negative when
endcomes first. For days left until a date, usedaysBetween(today(), dueDate).
#hour(date)
The hour of a date, 0 to 23, where the iPad is.
Gives back: Number
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
date | The date to read the hour of. | Date | Yes |
Examples
| Formula | Result |
|---|---|
hour(startDate) | 10 |
hour(addMinutes(startDate, 240)) | 14 |
hour(startDate) % 12 * 30 + minute(startDate) / 2 | 315 |
hour('soon') | Error: hour needs a date like '2026-10-28', not 'soon'. |
Good to know
- It's where the iPad is: 2:30 PM UTC is 10:30 AM in New York. The hour is 0 to 23: 0 is midnight.
- For an analog clock's hands, use the Clock Hand modifier: it keeps them moving on the Home Screen. As a formula, the hour hand's angle is
hour(now()) % 12 * 30 + minute(now()) / 2degrees. - In a widget,
now()is worked out again every minute.
#minute(date)
The minute of a date, 0 to 59.
Gives back: Number
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
date | The date to read the minute of. | Date | Yes |
Examples
| Formula | Result |
|---|---|
minute(startDate) | 30 |
minute(addMinutes(startDate, 45)) | 15 |
minute(startDate) * 6 | 180 |
minute('soon') | Error: minute needs a date like '2026-10-28', not 'soon'. |
Good to know
- It's 0 to 59.
- As an angle for a clock's minute hand:
minute(now()) * 6degrees, 6° a minute. The Clock Hand modifier turns a hand for you, and keeps it moving on the Home Screen.
#second(date)
The second of a date, 0 to 59.
Gives back: Number
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
date | The date to read the second of. | Date | Yes |
Examples
| Formula | Result |
|---|---|
second(startDate) | 0 |
second(addMinutes(startDate, 1.5)) | 30 |
second('soon') | Error: second needs a date like '2026-10-28', not 'soon'. |
Good to know
- It's 0 to 59.
- A widget is drawn again once a minute, so a formula with
second(now())only moves once a minute there. For a moving second hand, use the Clock Hand modifier.
#day(date)
The day of the month, 1 to 31.
Gives back: Number
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
date | The date to read the day of the month of. | Date | Yes |
Examples
| Formula | Result |
|---|---|
day(startDate) | 28 |
day(addDays(startDate, 4)) | 1 |
day('soon') | Error: day needs a date like '2026-10-28', not 'soon'. |
Good to know
- It's where the iPad is: 2:30 PM UTC is 10:30 AM in New York. So a time early in the UTC day can still be the day before:
day('2026-10-28T02:00:00Z')gives27. - For a calendar widget's big number, show
day(today());formatDate(today(), 'weekday')names the day above it.
#month(date)
The month of a date, 1 (January) to 12.
Gives back: Number
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
date | The date to read the month of. | Date | Yes |
Examples
| Formula | Result |
|---|---|
month(startDate) | 10 |
month(addDays(startDate, 10)) | 11 |
month('soon') | Error: month needs a date like '2026-10-28', not 'soon'. |
Good to know
- It's 1 for January to 12 for December. For the month's name, use
formatDate(date, 'month').
#year(date)
The year of a date.
Gives back: Number
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
date | The date to read the year of. | Date | Yes |
Examples
| Formula | Result |
|---|---|
year(startDate) | 2026 |
year(addDays(startDate, 70)) | 2027 |
year('soon') | Error: year needs a date like '2026-10-28', not 'soon'. |
Good to know
- For someone's age in whole years from a birthday,
year(today()) - year(birthday)is close; it's a year too many before the birthday comes round.
#weekday(date)
The day of the week, 1 (Sunday) to 7 (Saturday).
Gives back: Number
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
date | The date to read the day of the week of. | Date | Yes |
Examples
| Formula | Result |
|---|---|
weekday(startDate) | 4 |
weekday(addDays(startDate, 3)) | 7 |
weekday(startDate) > 1 && weekday(startDate) < 7 | true |
weekday('soon') | Error: weekday needs a date like '2026-10-28', not 'soon'. |
Good to know
- It's 1 for Sunday to 7 for Saturday, whatever the iPad's first day of the week. For the day's name, use
formatDate(date, 'weekday'). weekday(today()) > 1 && weekday(today()) < 7is true on a weekday, Monday to Friday.
#timestamp(date)
A date as seconds since 1970, as many web APIs write it.
Gives back: Number
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
date | A date. | Date | Yes |
Examples
| Formula | Result |
|---|---|
timestamp(startDate) | 1793197800 |
timestamp('1970-01-01T00:00:00Z') | 0 |
timestamp('soon') | Error: timestamp needs a date like '2026-10-28', not 'soon'. |
Good to know
- Many web APIs write dates as these seconds.
date(…)reads them back:date(1793197800)gives"2026-10-28T14:30:00Z".
#addMonths(date, months)
A date some months later (or earlier, with a minus), on the same day where it can be.
Gives back: Date
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
date | The date to count from. | Date | Yes |
months | How many months to add. Use a minus to go back. | Number | Yes |
Examples
| Formula | Result |
|---|---|
addMonths(startDate, 1) | "2026-11-28T15:30:00Z" |
addMonths('2026-01-31', 1) | "2026-02-28T05:00:00Z" |
addMonths(startDate, -12) | "2025-10-28T14:30:00Z" |
addMonths(startDate, 'one') | Error: addMonths needs a number, not text. |
Good to know
- It keeps the day and the time on the iPad's clock. A month after January 31 is February 28: the last day, when the month is shorter.
- In New York, 10:30 AM on November 28 is 15:30 UTC, an hour later than in October, because the clocks change on November 1.
- For years, add 12 months a year:
addMonths(startDate, 12).
#startOf(date, unit)
The start of the date's day, week, month or year.
Gives back: Date
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
date | Any date. | Date | Yes |
unit | 'day', 'week', 'month' or 'year'. | Text | Yes |
Examples
| Formula | Result |
|---|---|
startOf(startDate, 'day') | "2026-10-28T04:00:00Z" |
startOf(startDate, 'week') | "2026-10-25T04:00:00Z" |
startOf(startDate, 'month') | "2026-10-01T04:00:00Z" |
startOf(startDate, 'year') | "2026-01-01T05:00:00Z" |
startOf(startDate, 'decade') | Error: startOf's unit is day, week, month or year, not decade. |
Good to know
- It's midnight where the iPad is. A week starts on the iPad's first day of the week: Sunday in the US.
- This month's entries:
filter(entries, it.date >= startOf(today(), 'month')).
#secondsBetween(start, end)
Whole seconds from start to end.
Gives back: Number
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
start | The first date. | Date | Yes |
end | The second date. | Date | Yes |
Examples
| Formula | Result |
|---|---|
secondsBetween(startDate, '2026-10-28T14:31:30Z') | 90 |
secondsBetween('2026-10-28T14:31:30Z', startDate) | -90 |
secondsBetween(startDate, 'soon') | Error: secondsBetween needs a date like '2026-10-28', not 'soon'. |
Good to know
- It's negative when
endcomes first. - Time left on a timer:
secondsBetween(now(), endTime), written for people withformatDuration.
#minutesBetween(start, end)
Whole minutes from start to end.
Gives back: Number
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
start | The first date. | Date | Yes |
end | The second date. | Date | Yes |
Examples
| Formula | Result |
|---|---|
minutesBetween(startDate, '2026-10-28T16:00:00Z') | 90 |
minutesBetween(startDate, '2026-10-28T14:31:30Z') | 1 |
minutesBetween('2026-10-28T16:00:00Z', startDate) | -90 |
Good to know
- Only whole minutes count: 90 seconds is 1 minute.
#hoursBetween(start, end)
Whole hours from start to end.
Gives back: Number
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
start | The first date. | Date | Yes |
end | The second date. | Date | Yes |
Examples
| Formula | Result |
|---|---|
hoursBetween(startDate, '2026-10-29T14:30:00Z') | 24 |
hoursBetween(startDate, '2026-10-28T16:00:00Z') | 1 |
Good to know
- Only whole hours count: an hour and a half is 1 hour.
- It counts real hours, so across a change of clocks a day can be 23 or 25 of them.
#monthsBetween(start, end)
Whole months from start to end.
Gives back: Number
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
start | The first date. | Date | Yes |
end | The second date. | Date | Yes |
Examples
| Formula | Result |
|---|---|
monthsBetween('2026-01-15', startDate) | 9 |
monthsBetween(startDate, '2026-12-27') | 1 |
monthsBetween(startDate, '2026-12-28T15:30:00Z') | 2 |
Good to know
- Only whole months count, on the iPad's calendar: October 28 to December 27 is 1 month.
#yearsBetween(start, end)
Whole years from start to end: someone's age from their birthday.
Gives back: Number
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
start | The first date. | Date | Yes |
end | The second date. | Date | Yes |
Examples
| Formula | Result |
|---|---|
yearsBetween('1990-06-15', startDate) | 36 |
yearsBetween('1990-12-01', startDate) | 35 |
yearsBetween(startDate, '2020-01-01') | -6 |
Good to know
- Someone's age:
yearsBetween(birthday, today()). Only whole years count, so it goes up on the birthday.
#Lists
| Function | What it does | Gives back |
|---|---|---|
count(listOrText) | How many items in a list, or characters in text. | Number |
isEmpty(value) | Whether a list, text or object has nothing in it, or the value is null. | Bool |
sum(list) | Adds up a list of numbers. | Number |
average(list) | The average of a list of numbers. | Number |
median(list) | The middle number of a list, or the average of the two in the middle. | Number |
first(list) | The first item, or null. | Any |
last(list) | The last item, or null. | Any |
filter(list, condition) | The items where condition is true. it is each item: filter(todos, !it.done). | List |
find(list, condition) | The first item where condition is true, or null. | Any |
any(list, condition) | Whether condition is true for any item. it is each item. | Bool |
all(list, condition) | Whether condition is true for every item. it is each item. | Bool |
map(list, expression) | Turns each item into something else: map(expenses, it.amount). | List |
sort(list, key?, descending?) | Sorts a list, optionally by a key like it.date. descending is true or false. | List |
unique(list) | The list without repeats. | List |
append(list, item) | The list with an item added at the end. | List |
concat(lists...) | Lists joined into one. | List |
shuffle(list) | The list in a random order. | List |
keys(record) | A record's field names, alphabetically. | List |
values(record) | A record's values, in the order of keys(record). | List |
range(start, end) | The whole numbers from start to end: range(1, 5) is [1, 2, 3, 4, 5]. | List |
#count(listOrText)
How many items in a list, or characters in text.
Gives back: Number
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
listOrText | A list, text or a record. | List, text or record | Yes |
Examples
| Formula | Result |
|---|---|
count(tasks) | 3 |
count(name) | 3 |
count(coupon) | 0 |
count(user) | 3 |
count(total) | Error: count needs a list or text, not a number. |
Good to know
- For text, it counts characters as people see them, so an emoji with a skin tone is 1:
count('👋🏽')gives1. - For a record, it counts the fields.
nullcounts as 0. - Numbers and true/false are an error. To count digits, use
count(text(total)).
#isEmpty(value)
Whether a list, text or object has nothing in it, or the value is null.
Gives back: Bool
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
value | Any value. | Any value | Yes |
Examples
| Formula | Result |
|---|---|
isEmpty(nickname) | true |
isEmpty(coupon) | true |
isEmpty(tasks) | false |
isEmpty(' ') | false |
isEmpty(0) | false |
Good to know
- Empty text, an empty list, a record with no fields and
nullare empty. Numbers and true/false never are, not even 0. - Spaces count as something: use
isEmpty(trim(name))to treat a few spaces as empty.
#sum(list)
Adds up a list of numbers.
Gives back: Number
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
list | A list of numbers. | List | Yes |
Examples
| Formula | Result |
|---|---|
sum(scores) | 342 |
sum(map(items, it.qty * it.rate)) | 1540 |
sum([]) | 0 |
sum([1, '2']) | Error: sum needs numbers, not text. |
sum(1, 2) | Error: sum(list) can't take 2 arguments. |
Good to know
- An empty list adds up to 0.
- Every item must be a number. To add up a field,
mapit first:sum(map(items, it.qty))gives5. - To add a few numbers, use
+, or put them in a list:sum([1, 2]).
#average(list)
The average of a list of numbers.
Gives back: Number
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
list | A list of numbers. | List | Yes |
Examples
| Formula | Result |
|---|---|
average(scores) | 85.5 |
average([1, 2, 6]) | 3 |
average([]) | null |
round(average([1, 2, 2]), 1) | 1.7 |
average(map(tasks, it.title)) | Error: average needs numbers, not text. |
Good to know
- An empty list gives
null, since there's nothing to divide. Add a fallback:average([]) ?? 0gives0. - The answer keeps every decimal, so round it to show it.
#median(list)
The middle number of a list, or the average of the two in the middle.
Gives back: Number
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
list | A list of numbers. | List | Yes |
Examples
| Formula | Result |
|---|---|
median(scores) | 88.5 |
median([3, 1, 2]) | 2 |
median([]) | null |
median(tasks) | Error: median needs numbers, not an object. |
Good to know
- The middle of the numbers in order, or the average of the two in the middle. Unlike
average, one very big or small number doesn't pull it far.
#first(list)
The first item, or null.
Gives back: Any
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
list | Any list. | List | Yes |
Examples
| Formula | Result |
|---|---|
first(scores) | 70 |
first(tasks).title | "Call Sam" |
first([]) | null |
first(coupon) | Error: first needs a list, not null. |
first(name) | Error: first needs a list, not text. |
Good to know
- An empty list gives
null, and so does any field read from it:first([]).titlegivesnull. nullitself is an error, which matters while an API's answer hasn't loaded. Give a fallback list:first(coupon ?? [])givesnull.
#last(list)
The last item, or null.
Gives back: Any
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
list | Any list. | List | Yes |
Examples
| Formula | Result |
|---|---|
last(scores) | 95 |
last(tasks).title | "Pay rent" |
last([]) | null |
last(split('a/b/c', '/')) | "c" |
Good to know
- An empty list gives
null;nullitself is an error, likefirst.
#filter(list, condition)
The items where condition is true. it is each item: filter(todos, !it.done).
Gives back: List
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
list | The list to look through. | List | Yes |
condition | A formula worked out for each item, with it as the item. The item stays when it's true. | Condition | Yes |
Examples
| Formula | Result |
|---|---|
filter(scores, it > 80) | [95, 82, 95] |
map(filter(tasks, !it.done), it.title) | ["Buy milk", "Pay rent"] |
count(filter(tasks, it.done)) | 1 |
filter([], it > 1) | [] |
filter(coupon, it) | Error: filter needs a list, not null. |
Good to know
- The condition uses what counts as true, so
filter(list, it)keeps the items that aren't empty, 0, false ornull. - The items keep their order.
- Inside,
itis this function's item, even inside Repeat for Each's steps. Other names, like your variables, work as usual:filter(scores, it > total - 40)gives[95, 82, 95].
#find(list, condition)
The first item where condition is true, or null.
Gives back: Any
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
list | The list to look through. | List | Yes |
condition | A formula worked out for each item, with it as the item. | Condition | Yes |
Examples
| Formula | Result |
|---|---|
find(tasks, !it.done).title | "Buy milk" |
find(scores, it > 90) | 95 |
find(scores, it > 100) | null |
find(tasks, it.title == 'Walk dog').title ?? 'Not found' | "Not found" |
Good to know
- It stops at the first item where the condition is true.
- When nothing matches, it gives
null, and reading a field from that givesnulltoo, so a??after it covers both.
#any(list, condition)
Whether condition is true for any item. it is each item.
Gives back: Bool
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
list | Any list. | List | Yes |
condition | A formula that's true or false for each item, with it as the item. | True / False | Yes |
Examples
| Formula | Result |
|---|---|
any(scores, it > 90) | true |
any(tasks, it.done) | true |
any(scores, it > 100) | false |
any([], it > 0) | false |
Good to know
- It's the same as
count(filter(list, condition)) > 0, and stops at the first item that's true.
#all(list, condition)
Whether condition is true for every item. it is each item.
Gives back: Bool
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
list | Any list. | List | Yes |
condition | A formula that's true or false for each item, with it as the item. | True / False | Yes |
Examples
| Formula | Result |
|---|---|
all(scores, it >= 70) | true |
all(tasks, it.done) | false |
all([], it > 0) | true |
Good to know
- Everything done:
all(tasks, it.done). An empty list counts as all done.
#map(list, expression)
Turns each item into something else: map(expenses, it.amount).
Gives back: List
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
list | The list to go through. | List | Yes |
expression | A formula worked out for each item, with it as the item. Its answers make the new list. | Any formula | Yes |
Examples
| Formula | Result |
|---|---|
map(scores, it / 5) | [14, 19, 16.4, 19] |
map(tasks, it.title) | ["Call Sam", "Buy milk", "Pay rent"] |
map(items, it.qty * it.rate) | [1200, 340] |
map(range(1, 3), it * it) | [1, 4, 9] |
map([], it * 2) | [] |
Good to know
- The new list has as many items as the old one, in the same order.
- A
mapinside amaphas its ownit, so the inner one can't see the outer item.
#sort(list, key?, descending?)
Sorts a list, optionally by a key like it.date. descending is true or false.
Gives back: List
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
list | The list to sort. | List | Yes |
key | A formula worked out for each item, with it as the item, to sort by. | Any formula | No: the items themselves |
descending | true for largest first. | True / False | No: false |
Examples
| Formula | Result |
|---|---|
sort(scores) | [70, 82, 95, 95] |
sort(scores, it, true) | [95, 95, 82, 70] |
map(sort(tasks, it.title), it.title) | ["Buy milk", "Call Sam", "Pay rent"] |
sort(['b', 'B', 'a']) | ["B", "a", "b"] |
sort(scores, true) | [70, 95, 82, 95] |
Good to know
- The second value is always the key.
sort(scores, true)sorts every item by the same key,true, so nothing moves: for largest first, writesort(scores, it, true). - Numbers sort by size and text character by character, so capital letters come first. To ignore them, sort by
lowercase(it.title). - Dates written the same way sort in time order.
- Items that tie keep their order.
- Kinds that can't be compared sort as numbers, then text, then true/false, then lists and records, with
nulllast:sort([3, 'a', null, true, 1])gives[1, 3, "a", true, null]. Descending flips this order too, sonullcomes first:sort([1, null, 3], it, true)gives[null, 3, 1].
#unique(list)
The list without repeats.
Gives back: List
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
list | Any list. | List | Yes |
Examples
| Formula | Result |
|---|---|
unique(scores) | [70, 95, 82] |
unique(map(tasks, it.done)) | [true, false] |
unique([1, '1', 1.0]) | [1, "1"] |
count(unique(scores)) | 3 |
unique([]) | [] |
Good to know
- It keeps the first of each, in order.
- Items are repeats only when they're equal, kind and capitals included: the number 1 and the text '1' are different.
#append(list, item)
The list with an item added at the end.
Gives back: List
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
list | Any list. | List | Yes |
item | What to add at the end. | Any | Yes |
Examples
| Formula | Result |
|---|---|
append(scores, 60) | [70, 95, 82, 95, 60] |
append([], name) | ["Sam"] |
append(name, 'x') | Error: append needs a list, not text. |
Good to know
- It works out a new list. To change a list variable, use an Add to List step.
#concat(lists...)
Lists joined into one.
Gives back: List
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
lists | Two or more lists. | List | Yes |
Examples
| Formula | Result |
|---|---|
concat(scores, [1, 2]) | [70, 95, 82, 95, 1, 2] |
concat([1], [2], [3]) | [1, 2, 3] |
concat(scores, 5) | Error: concat needs lists, not a number. |
Good to know
- For one item,
appendreads better:append(scores, 60).
#shuffle(list)
The list in a random order.
Gives back: List
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
list | Any list. | List | Yes |
Examples
| Formula | Result |
|---|---|
count(shuffle(scores)) | 4 |
sort(shuffle(scores)) | [70, 82, 95, 95] |
shuffle(scores) | For example [82, 70, 95, 95] |
shuffle(name) | Error: shuffle needs a list, not text. |
Good to know
- It's a new order each time it's worked out. A random pick:
first(shuffle(tasks)).
#keys(record)
A record's field names, alphabetically.
Gives back: List
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
record | A record, like one from an API. | Record | Yes |
Examples
| Formula | Result |
|---|---|
keys(user) | ["address", "age", "name"] |
keys(user.address) | ["city"] |
keys(scores) | Error: keys needs an object, not a list. |
Good to know
- They're in alphabetical order, the same order
valuesuses.
#values(record)
A record's values, in the order of keys(record).
Gives back: List
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
record | A record. | Record | Yes |
Examples
| Formula | Result |
|---|---|
values(user.address) | ["London"] |
values(user) | [{"city":"London"}, 36, "Ada"] |
values(name) | Error: values needs an object, not text. |
Good to know
- In the order of
keys(record): alphabetical by field name.
#range(start, end)
The whole numbers from start to end: range(1, 5) is [1, 2, 3, 4, 5].
Gives back: List
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
start | The first number. | Number | Yes |
end | The last number, included. | Number | Yes |
Examples
| Formula | Result |
|---|---|
range(1, 5) | [1, 2, 3, 4, 5] |
range(-2, 2) | [-2, -1, 0, 1, 2] |
range(3, 1) | [] |
range(0.5, 3.5) | [1, 2, 3] |
range(1, 20000) | Error: range can make at most 10,000 numbers. |
Good to know
- It counts up by 1. When
endis smaller thanstart, the list is empty. - Decimals are rounded inward:
startup andenddown. - Use it with
mapto make lists:map(range(1, 3), 'Item ' + it)gives["Item 1", "Item 2", "Item 3"].
#Other
| Function | What it does | Gives back |
|---|---|---|
uuid() | A new unique id, for new list items. | Text |
typeOf(value) | What kind of value it is: number, text, bool, list, record or null. | Text |
parseJSON(text) | Reads JSON text into values: records, lists, numbers and text. | Any |
toJSON(value) | A value written as JSON text. | Text |
rgb(red, green, blue, opacity?) | A color from red, green and blue (0 to 255) and opacity (0 to 1): "#5B6CFF". | Text |
mix(color, otherColor, amount) | A color between two: amount 0 is the first, 1 the second. | Text |
#uuid()
A new unique id, for new list items.
Gives back: Text
Takes nothing: write the brackets with nothing between them.
Examples
| Formula | Result |
|---|---|
uuid() | For example "3f2b8c1e-9a4d-4c7b-8e2f-1a6d5c9b0e47" |
count(uuid()) | 36 |
uuid() == uuid() | false |
Good to know
- Each one is new, in lowercase letters and numbers with dashes.
- Use it to give a new list item an id of its own, so steps can find that item later, like Update in List with a Where of
it.id == params.id.
#typeOf(value)
What kind of value it is: number, text, bool, list, record or null.
Gives back: Text
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
value | Any value. | Any | Yes |
Examples
| Formula | Result |
|---|---|
typeOf(total) | "number" |
typeOf(name) | "text" |
typeOf(isMember) | "bool" |
typeOf(scores) | "list" |
typeOf(user) | "record" |
typeOf(coupon) | "null" |
typeOf(qtyText) | "text" |
Good to know
- Something typed is text, even when it's digits: read it with
number(…). - A date is text too.
#parseJSON(text)
Reads JSON text into values: records, lists, numbers and text.
Gives back: Any
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
text | JSON, as text. | Text | Yes |
Examples
| Formula | Result |
|---|---|
parseJSON('[1, 2]') | [1, 2] |
parseJSON('{"city": "Paris"}') | {"city":"Paris"} |
parseJSON('true') | true |
parseJSON('nope') | Error: parseJSON needs JSON text, not 'nope'. |
Good to know
- Call API and Load File read JSON already. This is for JSON that arrives as text, like a value someone pasted or one an API sent inside text.
#toJSON(value)
A value written as JSON text.
Gives back: Text
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
value | Any value. | Any | Yes |
Examples
| Formula | Result |
|---|---|
toJSON(scores) | "[70,95,82,95]" |
toJSON([true, null]) | "[true,null]" |
toJSON(total) | "120" |
Good to know
- A record's fields come out in alphabetical order.
#rgb(red, green, blue, opacity?)
A color from red, green and blue (0 to 255) and opacity (0 to 1): "#5B6CFF".
Gives back: Text
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
red | 0 to 255. | Number | Yes |
green | 0 to 255. | Number | Yes |
blue | 0 to 255. | Number | Yes |
opacity | 0 (clear) to 1 (solid). | Number | No: 1 |
Examples
| Formula | Result |
|---|---|
rgb(91, 108, 255) | "#5B6CFF" |
rgb(255, 0, 0, 0.5) | "#FF000080" |
rgb(300, -5, 0) | "#FF0000" |
rgb(scores, 0, 0) | Error: rgb needs a number, not a list. |
Good to know
- Use it anywhere a color goes, through a formula: a background that changes with a value.
- Numbers past 0 to 255 are held to it.
#mix(color, otherColor, amount)
A color between two: amount 0 is the first, 1 the second.
Gives back: Text
Takes
| Value | What it is | Kind | Required |
|---|---|---|---|
color | A color like '#22C55E'. | Color | Yes |
otherColor | Another color. | Color | Yes |
amount | 0 is the first color, 1 the second, 0.5 halfway. | Number | Yes |
Examples
| Formula | Result |
|---|---|
mix('#FF0000', '#0000FF', 0.5) | "#800080" |
mix('#000000', '#FFFFFF', 0.25) | "#404040" |
mix('#22C55E', '#EF4444', 0) | "#22C55E" |
mix('red', '#FFFFFF', 0.5) | Error: mix needs colors like '#5B6CFF', not 'red'. |
Good to know
- Green to red as time runs out:
mix('#22C55E', '#EF4444', 1 - secondsLeft / 1500). - Colors are written as
'#RRGGBB'or'#RRGGBBAA', as the color picker writes them.