Skip to main content

Formula Syntax & Functions

This is the full reference for everything you can use inside a Closot formula — every property type the formula engine understands, every built-in operator and boolean, and every available function with its description, parameters, and a working example.


Properties

Most database property types can be referenced directly inside a formula. The table below lists each property type, example usage, and the formula output type it returns.

Property TypeExample UsageFormula Output Type
Titleprop("Title") prop("Title").length()Text
Textprop("Notes") prop("Notes").length()Text
Selectprop("Category") == "Engineering"Text
Multi-Selectprop("Tags").length() prop("Tags").includes("Urgent")Text (list)
Checkboxprop("Reviewed") not prop("Reviewed")Boolean
Email, URL, Phone!empty(prop("Email")) link("Contact", "tel:" + prop("Phone"))Text
Unique IDprop("Item ID").split("-").first()Text
Created By, Edited Byprop("Created By").name() prop("Created By").email()Person
Personprop("Assignee") prop("Assignee").at(0).name()Person (list)
Date / Timeprop("Deadline") > now() dateBetween(prop("Joined"), now(), "days")Date
Numberprop("Score") / 100 pi() * prop("Radius") ^ 2Number
Relationprop("Projects").length() prop("Projects").filter(current.prop("Status") !== "Done")Page (list)
Rollupprop("Total Orders").length() prop("Monthly Cost") * 12Number, date, or list

Built-ins

Math Operators

Use these directly between values without calling a named function:

  • + — addition (also used to concatenate text strings)
  • - — subtraction
  • * — multiplication
  • % — modulo (remainder after division)

Examples:

2 * pi()
"hello" + " " + "world"

Boolean Values

  • true
  • false

Comparison Operators

Return true or false when comparing two values:

OperatorMeaning
==Equal to
>Greater than
>=Greater than or equal to
<Less than
<=Less than or equal to

Examples:

42 == 42 → true
"apple" == "orange" → false

Logical Operators

Combine boolean conditions. Each has three equivalent syntax forms:

AND — all conditions must be true:

true and false
true && false
and(true, false)

OR — at least one condition must be true:

true or false
true || false
or(true, false)

NOT — inverts a boolean:

not true
!true

Ternary Operator

A shorthand for if(). Evaluates a condition and returns one of two values:

X ? Y : Z

Equivalent to if(X, Y, Z) — if X is true, return Y; otherwise return Z.


Functions

Conditional Functions

if

Returns the first value if the condition is true; otherwise returns the second value.

if(true, 1, 2) → 1

ifs

Evaluates multiple conditions in sequence and returns the value paired with the first condition that is true. Use this as a cleaner alternative to deeply nested if() calls.

ifs(true, 1, true, 2, 3) → 1

Utility Functions

empty

Returns true if the value is empty. Values considered empty: 0, "", [].

empty(0) → true
empty("") → true

length

Returns the number of characters in a text string, or the number of items in a list.

length("hello") → 5
length([1, 2, 3]) → 3

Text Functions

substring

Extracts a portion of a string from a start position (inclusive) to an optional end position (exclusive).

substring("Closot", 0, 3) → "Clo"
substring("Closot", 3) → "sot"

contains

Returns true if the search string is found anywhere within the target string.

contains("Closot Workspace", "Workspace") → true

test

Returns true if the value matches a regular expression pattern.

test("report-2026", "\\d") → true
test("report", "\\d") → false

match

Returns all regex matches as a list.

match("alpha beta alpha", "alpha") → ["alpha", "alpha"]

replace

Replaces the first occurrence of a regex match with the replacement string.

replace("Closot Closot", "C", "B") → "Blosot Closot"

replaceAll

Replaces all occurrences of a regex match with the replacement string.

replaceAll("Closot Closot", "C", "B") → "Blosot Blosot"

lower

Converts a string to lowercase.

lower("CLOSOT") → "closot"

upper

Converts a string to uppercase.

upper("closot") → "CLOSOT"

repeat

Repeats a string a specified number of times.

repeat("ha", 3) → "hahaha"

Creates a clickable hyperlink from a label and URL.

link("Open dashboard", "https://app.closot.com")

style

Applies text formatting and/or color to a string output.

style("Urgent", "b", "red")

Format codes: b (bold), u (underline), i (italic), c (code), s (strikethrough)

Colors: gray, brown, orange, yellow, green, blue, purple, pink, red

Append _background to apply as a background color instead of text color — e.g., "orange_background".

unstyle

Removes formatting from a string. When called without arguments, removes all formatting. Pass specific codes to remove only those styles.

unstyle("Text") → removes all styles
unstyle("Text", "b") → removes bold only

format

Converts any value type to a text string.

format(2026) → "2026"
format(now()) → "April 16, 2026 9:00 AM"

trim

Removes leading and trailing whitespace from a string.

" closot ".trim() → "closot"

Math Functions

add

Returns the sum of two numbers.

add(12, 8) → 20
12 + 8 → 20

subtract

Returns the difference between two numbers.

subtract(20, 8) → 12
20 - 8 → 12

multiply

Returns the product of two numbers.

multiply(6, 7) → 42
6 * 7 → 42

mod

Returns the remainder after dividing the first number by the second.

mod(17, 5) → 2
17 % 5 → 2

pow

Returns the base raised to the power of the exponent.

pow(2, 10) → 1024
2 ^ 10 → 1024

divide

Returns the quotient of two numbers.

divide(9, 4) → 2.25
9 / 4 → 2.25

min

Returns the smallest value from the provided numbers or list.

min(3, 1, 4, 1, 5) → 1
min([10, 20, 30]) → 10

max

Returns the largest value from the provided numbers or list.

max(3, 1, 4, 1, 5) → 5
max([10, 20, 30]) → 30

sum

Returns the total of all provided numbers or list values.

sum(1, 2, 3) → 6
sum([1, 2, 3], 4, 5) → 15

median

Returns the middle value of a set of numbers.

median(1, 2, 4) → 2
median([1, 2, 3], 4) → 2.5

mean

Returns the arithmetic average of a set of numbers.

mean(1, 2, 3) → 2
mean([1, 2, 3], 4, 5) → 3

abs

Returns the absolute value (removes any negative sign).

abs(42) → 42
abs(-42) → 42

round

Rounds a number to the nearest integer. Optionally specify decimal places (positive) or round to a power of ten (negative).

round(0.4) → 0
round(1.567, 2) → 1.57
round(1234, -2) → 1200

ceil

Returns the smallest integer that is greater than or equal to the number (rounds up).

ceil(0.1) → 1
ceil(-0.9) → 0

floor

Returns the largest integer that is less than or equal to the number (rounds down).

floor(0.9) → 0
floor(-0.1) → -1

sqrt

Returns the positive square root of a number.

sqrt(9) → 3
sqrt(2) → 1.4142135623730951

cbrt

Returns the cube root of a number.

cbrt(27) → 3
cbrt(125) → 5

exp

Returns e raised to the power of x, where e ≈ 2.718.

exp(1) → 2.718281828459045
exp(0) → 1

ln

Returns the natural logarithm of a number (base e).

ln(2.718281828459045) → 1
ln(10) → 2.302585092994046

log10

Returns the base-10 logarithm of a number.

log10(10) → 1
log10(10000) → 4

log2

Returns the base-2 logarithm of a number.

log2(8) → 3
log2(1024) → 10

sign

Returns 1 if the number is positive, -1 if negative, or 0 if zero.

sign(99) → 1
sign(-99) → -1
sign(0) → 0

pi

Returns the mathematical constant π (pi).

pi() → 3.141592653589793

e

Returns the mathematical constant e (Euler's number).

e() → 2.718281828459045

toNumber

Parses a number from a text string, date, or boolean value.

toNumber("42") → 42
toNumber(true) → 1
toNumber(now()) → 1713254400000 (Unix timestamp in milliseconds)

Date & Time Functions

now

Returns the current date and time at the moment the formula is evaluated.

now() → @April 16, 2026 9:00 AM

today

Returns the current date without any time component.

today() → @April 16, 2026

minute

Returns the minute component of a date (0–59).

minute(parseDate("2026-04-16T09:45Z")) → 45

hour

Returns the hour component of a date (0–23).

hour(parseDate("2026-04-16T09:45Z")) → 9

day

Returns the day of the week as a number (1 = Monday, 7 = Sunday).

day(parseDate("2026-04-16")) → 4 (Thursday)

date

Returns the day of the month (1–31).

date(parseDate("2026-04-16")) → 16

week

Returns the ISO week number of the year (1–53).

week(parseDate("2026-01-05")) → 2

month

Returns the month as a number (1–12).

month(parseDate("2026-04-16")) → 4

year

Returns the four-digit year.

year(now()) → 2026

dateAdd

Adds a specified amount of time to a date and returns the resulting date.

Supported units: "years", "quarters", "months", "weeks", "days", "hours", "minutes"

dateAdd(now(), 7, "days") → @April 23, 2026 9:00 AM
dateAdd(now(), 3, "months") → @July 16, 2026 9:00 AM

dateSubtract

Subtracts a specified amount of time from a date.

dateSubtract(now(), 7, "days") → @April 9, 2026 9:00 AM

dateBetween

Returns the difference between two dates expressed in a specified unit.

dateBetween(now(), parseDate("2026-01-01"), "days") → 105

dateRange

Creates a date range from a start date and end date.

dateRange(prop("Start"), prop("End")) → @January 1, 2026 → April 16, 2026

dateStart

Returns the start date of a date range property.

dateStart(prop("Sprint Dates")) → @January 1, 2026

dateEnd

Returns the end date of a date range property.

dateEnd(prop("Sprint Dates")) → @January 14, 2026

timestamp

Returns the Unix timestamp (milliseconds elapsed since January 1, 1970) for a given date.

timestamp(now()) → 1713254400000

fromTimestamp

Returns a date from a Unix timestamp in milliseconds. Note: seconds and milliseconds are not retained in the output.

fromTimestamp(1713254400000) → @April 16, 2026

formatDate

Formats a date as a custom text string using format tokens.

Common tokens: YYYY (year), MM (month), DD (day), h (hour), mm (minutes)

formatDate(now(), "MMMM D, YYYY") → "April 16, 2026"
formatDate(now(), "MM/DD/YYYY") → "04/16/2026"

parseDate

Parses a date string formatted according to ISO 8601 and returns a date value.

parseDate("2026-04-16") → @April 16, 2026
parseDate("2026-04-16T09:00:00Z") → @April 16, 2026 9:00 AM

Person Functions

name

Returns the display name of a person.

name(prop("Created By")) → "Jordan Kim"

email

Returns the email address of a person.

email(prop("Created By")) → "jordan@company.com"

List Functions

at

Returns the value at a specified index in a list (zero-based).

at([10, 20, 30], 1) → 20

first

Returns the first item in a list.

first(["alpha", "beta", "gamma"]) → "alpha"

last

Returns the last item in a list.

last(["alpha", "beta", "gamma"]) → "gamma"

slice

Returns a portion of a list from a start index (inclusive) to an optional end index (exclusive).

slice([1, 2, 3, 4, 5], 1, 3) → [2, 3]
slice(["a", "b", "c"], 1) → ["b", "c"]

concat

Combines two or more lists into a single list.

concat([1, 2], [3, 4]) → [1, 2, 3, 4]

sort

Returns a new list with items sorted in ascending order.

sort([5, 2, 8, 1]) → [1, 2, 5, 8]

reverse

Returns a new list with items in reversed order.

reverse(["first", "second", "third"]) → ["third", "second", "first"]

join

Combines list items into a single text string with a separator between each item.

join(["red", "green", "blue"], " | ") → "red | green | blue"

split

Splits a text string into a list using a specified separator.

split("hr,finance,engineering", ",") → ["hr", "finance", "engineering"]

unique

Returns a new list with duplicate values removed.

unique([1, 2, 2, 3, 3, 3]) → [1, 2, 3]

includes

Returns true if the list contains the specified value.

includes(["draft", "review", "published"], "review") → true

find

Returns the first list item for which a condition evaluates to true. current refers to the item being evaluated.

find(["draft", "review", "published"], current == "review") → "review"

findIndex

Returns the zero-based index of the first item for which a condition is true.

findIndex(["draft", "review", "published"], current == "review") → 1

filter

Returns a new list containing only the items for which the condition is true.

filter([10, 25, 50, 75], current > 30) → [50, 75]

some

Returns true if at least one item in the list satisfies the condition.

some([10, 25, 50], current > 40) → true

every

Returns true only if every item in the list satisfies the condition.

every([10, 25, 50], current > 5) → true
every([10, 25, 50], current > 20) → false

map

Returns a new list by applying an expression to every item. current references the current item; index references its position.

map([1, 2, 3], current * 10) → [10, 20, 30]
map([1, 2, 3], current + index) → [1, 3, 5]

flat

Flattens a list of lists into a single flat list. Has no effect on a list that is already flat.

flat([[1, 2], [3, 4], [5]]) → [1, 2, 3, 4, 5]
flat([1, 2, 3]) → [1, 2, 3]

Comparison & Assignment Functions

id

Returns the unique ID of a page. When called with no arguments, returns the ID of the page the formula belongs to.

id() → ID of the current page
id(prop("Related Project").first()) → ID of the first related project

equal

Returns true if two values are equal. Equivalent to using ==.

equal(5, 5) → true
"a" == "b" → false

unequal

Returns true if two values are not equal. Equivalent to using !=.

unequal(5, 10) → true
"a" != "a" → false

let

Assigns a value to a named variable, then evaluates an expression that can reference that variable. Useful for avoiding repetition in complex formulas.

let(greeting, "Welcome back, ", greeting + prop("Name") + "!")
→ "Welcome back, Jordan!"

lets

Assigns values to multiple named variables at once, then evaluates an expression using any of them.

lets(dept, "Engineering", level, "Senior", dept + " — " + level)
→ "Engineering — Senior"

trim

Removes white space from the beginning and end of text.

" closot ".trim() = "closot"