Notion Formula Syntax

Learn the basics of Notion's formula syntax.

Notion new formulas share many similarities with JavaScript syntax, though Notion Formula syntax is simplified.

In Notion formulas, parentheses () are used to open and close functions:

abs(-20) /* Output: 20 */

In Formulas 2.0, you can now also write functions using a dot notation:

-20.abs() /* Output: 20 */

Commas , are used to separate arguments in functions:

add(34, 8) /* Output: 42 */

Quotation marks " are used to:

  1. Denote strings
  2. Reference property names within the prop() function. Note this only applies to formulas shown outside of the formula editor, property references are shown as tokens — like Title — inside of it.
/* Assume the value of the Name property is "Luffy" */ join(["Monkey D.", prop("Title")], " ") /* Output: Monkey D. Luffy */

As in most programming languages, the plus sign + can be used for both numeric addition and string concatenation:

38 + 4 /* Output: 42 */ "Monkey" + "D. " + "Luffy" /* Output: Monkey D. Luffy */

There are several other operators, which perform calculations on one or more operands.

Most operators are binary operators, which means they work on two operands:

10 / 2 /* Output: 5 */ (4 + 5) == 9 /* Output: true */ 9 < 8 /* Output: false */

The ternary operator (? and :) operates on three operands, and can be substituted for the if function:

42 > 25 ? "Yes" : "No" /* Output: Yes */ if(42 > 25, "Yes", "No") /* Output: Yes */

When performing mathematical operations, operators follow standard mathematical order of operations.

Refer to the operator precedence guide (which also defines precedence for Boolean operators) for more detail, and remember that you can always use parentheses () to specify the order you want:

4 + 8 / 4 - 2 ^ 2 /* Output: 2 */ 4 + (8 / 4) - (2 ^ 2) /* Output: 2 */ (4 + 8) / (4 - 2) ^ 2 /* Output: 3 */ /* 👇 simplified */ (12) / (4) /* Output: 3 */

Notion’s formula editor includes many functions, which are reusable blocks of code that you can call.

Functions accept one or more arguments, operate on the data of those arguments using internal logic, and output a result.

Arguments must be of the correct data type; otherwise, your formula will throw an error.

/* function_name(argument_1, argument_2) */ divide(10, 2) /* Output: 5 */ /* Note that spaces between arguments are optional, but commas are required. */ join(["My","Chemical", "Romance"], " ") /* Output: My Chemical Romance */

Functions can accept other functions as arguments. The inner-most functions are executed first, and their output is used as the argument value for the function that contains them.

Now that you have an overall understanding of how Notion formula syntax works, you should be able to fully understand the details and examples provided for each constant, operator, and function.

About the Author

My name is Thomas Frank, and I'm a Notion-certified writer, YouTuber, and template creator. I've been using Notion since 2018 to organize my personal life and to run my business and YouTube channel. In addition to this formula reference, I've created a free Notion course for beginners and several productivity-focused Notion templates. If you'd like to connect, follow me on Twitter.

🤔 Have an UB Question?

Fill out the form below and I’ll answer as soon as I can! ~Thomas

🤔 Have a Question?

Fill out the form below and I’ll answer as soon as I can! ~Thomas