Skip to content
Clastly Pro

Functions you can use in formulas

Updated:

On this page
  1. Operators
  2. Arithmetic functions
  3. Number functions
  4. Functions that return a date
  5. Functions that return the difference between two dates
  6. Functions that return part of a date
  7. Text functions
  8. List functions
  9. Logic and comparison functions

You can use the following operators and functions in formula field expressions. Braces such as {Price} refer to fields.

Operators

Enter operators with the keys in the formula editor. Choose comparison operators from the menu on the = key. Multiplication and division are calculated before addition and subtraction. Use ( ) to calculate a part first.

OperatorDescriptionExample
+Adds. Same as sum.{Price} + {Shipping}
− or -Subtracts. Same as subtract.{Price} − {Discount}
× or *Multiplies. Same as multiply.{Price} × {Quantity}
÷ or /Divides. Same as divide.{Price} ÷ 2
=Returns true when the two sides are equal. Same as equal.{Status} = "Done"
≠, !=, or <>Returns true when the two sides are not equal. Same as notEqual.{Status} ≠ "Done"
>Returns true when the left side is greater than the right side. Same as greater.{Stock} > 5
≥ or >=Returns true when the left side is greater than or equal to the right side. Same as greaterOrEqual.{Stock} ≥ 5
<Returns true when the left side is less than the right side. Same as less.{Stock} < 5
≤ or <=Returns true when the left side is less than or equal to the right side. Same as lessOrEqual.{Stock} ≤ 5

Arithmetic functions

NameDescriptionExample
sumAdds numbers and the elements of number lists. Empty values are ignored.sum({Price}, {Shipping}, 5) → The total of Price, Shipping, and 5
{Price} + {Shipping} + 5
subtractSubtracts the second value from the first. If any argument is empty, the result is empty.subtract({Price}, {Discount}) → Price minus Discount
{Price} − {Discount}
multiplyMultiplies the values together. If any argument is empty, the result is empty.multiply({Price}, {Quantity}) → Price multiplied by Quantity
{Price} × {Quantity}
divideDivides the first value by the second. Dividing by 0 is an error. If any argument is empty, the result is empty.divide({Price}, 2) → Half of Price
{Price} ÷ 2
moduloReturns the remainder after dividing the first number by the second. Dividing by 0 is an error. If any argument is empty, the result is empty. The remainder has the same sign as the dividend.modulo({Quantity}, 12) → The remainder after dividing Quantity by 12
powerRaises the base to the exponent. If any argument is empty, the result is empty.power(2, 3) → 8 (2 raised to the third power)

Number functions

NameDescriptionExample
averageReturns the average of numbers and the elements of number lists. Empty values are ignored.average({Price}, {Shipping}) → The average of Price and Shipping
minimumReturns the smallest of the numbers and list elements. Empty values are ignored.minimum({Price}, 1000) → The smaller of Price and 1000
maximumReturns the largest of the numbers and list elements. Empty values are ignored.maximum({Quantity}, 1) → Quantity or 1, whichever is larger
roundRounds a value to the given number of decimal places. Places is a whole number from 0 to 10. Negative numbers are rounded by their absolute value.round(12.345, 2) → 12.35
roundUpRounds away from zero to the given number of decimal places. Places is a whole number from 0 to 10.roundUp(12.341, 2) → 12.35
roundDownRounds toward zero to the given number of decimal places. Places is a whole number from 0 to 10.roundDown(12.349, 2) → 12.34
absoluteReturns the value without its minus sign.absolute(-1500) → 1500
squareRootReturns the square root of a number that is 0 or greater. A negative number is an error.squareRoot(144) → 12

Functions that return a date

NameDescriptionExample
todayReturns today’s date in the device calendar, without a time. It refreshes when the day changes.today() → Today’s date
nowReturns the current date and time. It refreshes about every hour while the app is open.now() → The current date and time
addMinutesMoves a date and time forward by the given minutes. A negative number moves it back. The date must include a time. Works only with dates that include a time.addMinutes({Appointment}, 30) → The date and time 30 minutes after Appointment
addHoursMoves a date and time forward by the given hours. A negative number moves it back. The date must include a time. Works only with dates that include a time.addHours({Appointment}, 2) → The date and time 2 hours after Appointment
addDaysAdds calendar days to a date. A negative whole number moves it back. The amount must be a whole number.addDays({Due Date}, 7) → The date 7 days after Due Date
addWeeksAdds a whole number of weeks to a date. The amount must be a whole number.addWeeks({Due Date}, 2) → The date 2 weeks after Due Date
addMonthsAdds a whole number of months to a date. The amount must be a whole number.addMonths({Due Date}, 1) → The date 1 month after Due Date
addYearsAdds a whole number of years to a date. The amount must be a whole number.addYears({Due Date}, 1) → The date 1 year after Due Date

Functions that return the difference between two dates

NameDescriptionExample
daysBetweenReturns the number of calendar days from the start date to the end date. Times are ignored. Counts calendar days and ignores the time. If the end is before the start, the result is negative.daysBetween({Start Date}, {End Date}) → The number of calendar days from Start Date to End Date
minutesBetweenReturns the elapsed minutes between two date-times, truncated toward zero. Both dates must include a time. Truncates toward zero. Both dates must include a time. If the end is before the start, the result is negative.minutesBetween({Start Date}, {End Date}) → The elapsed minutes from Start Date to End Date
hoursBetweenReturns the elapsed hours between two date-times, truncated toward zero. Both dates must include a time. Truncates toward zero. Both dates must include a time. If the end is before the start, the result is negative.hoursBetween({Start Date}, {End Date}) → The elapsed hours from Start Date to End Date
weeksBetweenReturns the whole weeks between two dates, truncated toward zero. Days short of a full week are not counted. Divides the number of days by 7 and truncates toward zero. If the end is before the start, the result is negative.weeksBetween({Start Date}, {End Date}) → The number of complete weeks from Start Date to End Date
monthsBetweenReturns the complete calendar months between two dates. Days short of a full month are not counted. Counts only complete months and ignores the time. If the end is before the start, the result is negative.monthsBetween({Start Date}, {End Date}) → The number of complete calendar months from Start Date to End Date
yearsBetweenReturns the complete calendar years between two dates. Counts only complete years and ignores the time. If the end is before the start, the result is negative.yearsBetween({Start Date}, {End Date}) → The number of complete calendar years from Start Date to End Date

Functions that return part of a date

NameDescriptionExample
yearReturns the year of a date.year({Due Date}) → The year of Due Date
monthReturns the month of a date, from 1 to 12.month({Due Date}) → The month of Due Date, from 1 to 12
dayOfMonthReturns the day of the month of a date, from 1 to 31.dayOfMonth({Due Date}) → The day of the month of Due Date, from 1 to 31
weekdayReturns the weekday as a number from 1 (Monday) to 7 (Sunday).weekday({Due Date}) → The weekday of Due Date: Monday is 1 and Sunday is 7
hourReturns the hour of a date-time, from 0 to 23. The date must include a time. Works only with dates that include a time.hour({Appointment}) → The hour of Appointment, from 0 to 23
minuteReturns the minute of a date-time, from 0 to 59. The date must include a time. Works only with dates that include a time.minute({Appointment}) → The minute of Appointment, from 0 to 59

Text functions

NameDescriptionExample
joinJoins fields and text into one piece of text. Numbers, dates, checkboxes, and selections are joined as they appear on screen. A checkbox becomes “Yes” or “No”.join({Name}, " - ", {Status}) → Name and Status separated by ” - ”
lengthReturns the number of characters in text, or the number of elements in a list.length({Name}) → The number of characters in Name
{Name}.length()
uppercaseConverts text to uppercase.uppercase("Clastly") → "CLASTLY"
{Name}.uppercase()
lowercaseConverts text to lowercase.lowercase("Clastly") → "clastly"
{Name}.lowercase()
trimRemoves leading and trailing whitespace and line breaks from text.trim(" Clastly ") → "Clastly"
{Notes}.trim()
replaceAllReplaces every occurrence of the search text with the replacement text. If the search text is empty, the original text is returned unchanged.replaceAll({Name}, "old", "new") → Name with every “old” replaced by “new”
leftReturns the given number of characters from the left end of the text. The count must be a whole number, 0 or greater.left({Name}, 3) → The first three characters of Name
rightReturns the given number of characters from the right end of the text. The count must be a whole number, 0 or greater.right({Name}, 3) → The last three characters of Name
toNumberConverts text to a number. When the text cannot be converted, the result is empty. Full-width digits and comma thousands separators are accepted.toNumber("1500") → The number 1500
toDateTimeConverts text to a date and time. When the text cannot be converted, the result is empty. Accepts text such as 2026-10-09T09:00:00Z, 2026-10-09, 2026/10/09, and 2026-10-09 09:00. Text without a time zone is read in the device’s time zone.toDateTime("2026-10-09T09:00:00Z") → October 9, 2026 at 09:00 UTC, displayed in the local time zone

List functions

NameDescriptionExample
filterKeeps the list elements that satisfy a condition. In the condition, current refers to each element.[1, 2, 3].filter(current > 1) → A list containing 2 and 3
mapApplies an expression to each list element. In the expression, current refers to each element.[1, 2].map(current * 2) → A list containing 2 and 4
medianReturns the median of numbers and numeric lists. With an even number of elements, it is the average of the two middle values.median([1, 3], 2) → 2, the middle value of 1, 2, and 3
flatFlattens one level of nested lists. Use flat before passing a nested list to a number function.flat([[1, 2], [3]]) → A list containing 1, 2, and 3

Logic and comparison functions

NameDescriptionExample
ifReturns the second value when the condition is true and the third when it is false. The result type follows the result type of the formula field.if({Completed}, "Done", "Pending") → "Done" when Completed is checked, otherwise "Pending"
andReturns true when every value is true. A missing value counts as false.and({Completed}, {Approved}) → True when both Completed and Approved are checked
orReturns true when any value is true. A missing value counts as false.or({Completed}, {Approved}) → True when either Completed or Approved is checked
notReturns true when the value is false. A missing value counts as false.not({Completed}) → True when Completed is not checked
isEmptyReturns true when the value is missing, blank text, or an empty selection, file list, or list. Numbers and checkboxes are never empty.isEmpty({Notes}) → True when Notes is empty
containsReturns true when text contains the search string or a list contains the searched value. Text matching is case sensitive. An empty search string matches any text.contains({Name}, "Book") → True when Name contains “Book” with the same capitalization
equalReturns true when both sides are equal. Works with numbers, dates, checkboxes, and text.equal({Status}, "Done") → True when Status is “Done”
{Status} = "Done"
notEqualReturns true when the two sides are not equal. Works with numbers, dates, checkboxes, and text.notEqual({Status}, "Done") → True when Status is not “Done”
{Status} ≠ "Done"
greaterReturns true when the left side is greater than the right side. Compares two numbers or two dates.greater({Price}, 1000) → True when Price is greater than 1000
{Stock} > 5
greaterOrEqualReturns true when the left side is greater than or equal to the right side. Compares two numbers or two dates.greaterOrEqual({Price}, 1000) → True when Price is at least 1000
{Stock} ≥ 5
lessReturns true when the left side is less than the right side. Compares two numbers or two dates.less({Quantity}, 10) → True when Quantity is less than 10
{Stock} < 5
lessOrEqualReturns true when the left side is less than or equal to the right side. Compares two numbers or two dates.lessOrEqual({Quantity}, 10) → True when Quantity is at most 10
{Stock} ≤ 5