A more user-friendly editor, 3 new data types, over 30 additional functions, support for variables — and much more. There’s a lot to cover, so let’s jump in!
New Formula Editor
Notion’s new formula editing experience has been upgraded in a number of ways.
Multiline Editing: no more one-line formulas! Create a new line with
Code Indentation: make your formulas more readable by indenting with
Inline Comments: keep track of what your formula does with
/* handy comments */
Property Tokens: Property references like
prop("This")are now shown like
Thisin the editor.
New Data Types
Lists can hold items of any data type and are surrounded by square brackets. Lists are displayed as:
- Comma-separated: strings, numbers, and dates.
- Space-separated: People, booleans, and pages.
These represent Notion users, like those found in a Person property. People are displayed as full names with a photo.
These represent Notion pages, like those found in a Relation property. Pages are displayed as a rich page link with a page icon.
New & Updated Functions
- concat: Now concatenates lists, use + for concatenating strings instead
- join: Now joins items in a list, but still returns a string as per F1.0 behaviour
- slice: Now slices lists, use substring to slice strings instead
- start: Renamed to dateStart
- end: Renamed to dateEnd
Six functions have been removed in favour of using their operator versions or other alternatives.
2 > 1
2 >= 1
2 < 1
2 <= 1
Notion now supports variables! This is a huge step towards much more concise formulas. Formulas 2.0 introduces two types of variables: built-in and user-defined.
A number of the new functions allow you to reference built-in
index variables, which return the current item in the list and its place in that list respectively.
Functions that allow for the use of
Read more about built-in variables.
Variables can be created using new
lets functions. Note that these both work in exactly the same way, apart from:
- let allows for only one variable to be created.
- lets allows for multiple variables to be created.
Read more about user-defined variables.
The majority of functions can now be written in two ways. The first we’ll refer to as the regular notation, and the new version as dot notation.
/* Regular Notation: All arguments are added within the () brackets */ dateAdd(now(), 2, "days") /* ↑...↑ First argument */ /* Dot Notation: The first argument is added before the dot */ now().dateAdd(2, "days")
The following functions cannot be written in the dot notation.
Simpler Nested if Statements
Gone are the days of multiple nested
if statements! The introduction of
ifs allows for a much more elegant way of handling if-else statements.