Notion recently made a major update to their formulas to provide users with faster and more efficient workflows. Here’s what’s new with Notion Formulas!
With Notion formulas 2.0 users can create their own variables, retrieve workspace information faster, and update formulas for richer data outputs. Here’s how to do it:
How to Update Formulas for Rich Data Outputs
Previously, formulas only supported text, numeric, and checkbox (boolean) outputs. With formulas 2.0, formulas now support rich data outputs, such as lists, objects, and dates. To preserve output compatibility, all existing formulas that reference rollup, person, file, and multi-select properties were converted to text.Want to Create a Guide Like This? ➡️ Click Here
This means that if you had a formula that returned a list of people, it would now return a comma-separated string of the people's names. To use the rich data type improvements, you need to remove the conversion language from your formulas.
For example, if you had a formula that was prop("Person").map(current.format()).join(", "), you would need to change it to prop("Person").
How to Call Workspace Level Information from Properties
Previously, if you wanted to access workspace-level information like the names and emails of people tagged in your database, you had to create these as their own properties. This could be time-consuming and could make your databases more cluttered.Want to Create a Guide Like This? ➡️ Click Here
With the latest update, you can now access this information directly without having to create separate properties. To do this, you can use the prop() function to reference the workspace-level information.
For example, if you want to retrieve the name of the person who created a database, you can use the following formula:prop("Created By").name()
This will return the name of the person who created the database. You can also use the email() function to retrieve the email address of the person who created the database.
How to Create Your Own Variables with "let"
Previously, formulas in Notion could not create local variables. This meant that if you wanted to use the same value multiple times in a formula, you had to repeat the calculation each time - which made formulas more complex and difficult to read. Want to Create a Guide Like This? ➡️ Click Here
Formulas 2.0 now supports local variable creation. Meaning you can now create a variable and use it throughout your formula, without having to repeat the calculation.This can make your formulas more concise and easier to read.
Here is an example of how you can use local variables in a formula:let(salesTax, prop("Subtotal") * 0.099),
prop("Subtotal") + salesTax
This formula first creates a variable called salesTax and assigns it the value of the Subtotal property multiplied by 0.099.The formula then uses the salesTax variable to calculate the total cost, which is the sum of the Subtotal property and the salesTax variable.
How to Reference Properties in Related Databases
To create a property in a related Notion database, you had to create a rollup. With Formulas 2.0, you can now reference properties in related databases without having to create rollups.
To do this, you can use the prop() function with the name of the related database and the name of the property.
For example, if you have a database of Projects related to a database of Tasks, and you want to reference the Status property of the Tasks database, you would use the following formula: prop("Tasks").prop("Status") - this will return the value of the Status property for the related task.
You can also use the map(), filter(), and length() functions to manipulate the data from the related database.
For example, the following formula will return the number of completed tasks in the related database: prop("Tasks").map(current.prop("Status")).filter(current == "Done").length()
This new feature can be very powerful, as it allows you to create more complex and dynamic formulas.
In this article, we have explored the new features and capabilities of Notion formulas 2.0. We have seen how these new features can be used to create dynamic and interactive databases, calculate sums, create rollups, and more.
We have also seen how these new features can be used to improve the usability and functionality of Notion workspaces. We hope this article has given you a good overview of Notion formulas 2.0. If you are interested in learning more, check out Driveway's Ultimate Guide to Notion.