Notion Formulas 2.0: Overview and Applications
Key Changes in Notion Formulas 2.0
-
Rich Content Output
- Formulas can now output pages.
- Clicking on a page in a formula takes you to that page.
-
Improved Readability
- Code Editor Features: Line breaks (Shift+Enter), comments (/.../), and indentation are now supported.
- Comments: Can be multi-line.
- Indentation: Use Tab to indent code, making it more readable.
-
Dot Notation
- New way to write formulas starting with the argument followed by the function.
- Example: Instead of
sum(a, b, c)
, you can write (a, b, c).sum()
.
- Easier to read and debug complex formulas.
-
Error Feedback
- Errors are now underlined in red with explanations, making debugging simpler.
-
Real-time Updates
- Changes inside a formula update results dynamically, but need to be confirmed using "Done" or Command+Enter to update throughout the database.
-
New Functions
- Notion has introduced several new functions for enhanced formula capabilities.
Example Applications
Creating a Project Dashboard
- Filtered Tasks
- Use
filter
function to filter tasks by status.
- Use
length
to count tasks (e.g., not started tasks).
- Styled Text
- Use
style
function to change text appearance (bold, color, etc.).
- Dot Notation in Practice
- Easier to apply multiple functions sequentially without losing track of parentheses.
- Example:
tasks.filter(current.status == 'not started').length
.
- List Creation
- Use
join
function to format and join list items with custom delimiters like new lines, tabs, and symbols.
- Dynamic Content
- Clickable tasks and statuses, providing intuitive project tracking.
Tracking Client Payments
- Using
let
for Variables
let
function to declare variables that can be referenced multiple times in the same formula.
- Simplifies complex formulas by reducing repetition.
- Constructing Dates
- Use
parseDate
function to create real date properties from strings.
- Example: Construct a date using current year and month, and a fixed start day.
- Date Comparisons
- Compare current date (
now
) with constructed date to determine if a client has paid for the month.
- Adjust the date based on whether the payment date has passed or not.
General Tips
- Styling
- Formulas can include styling to improve visual appeal and clarity.
- Experimentation
- Explore available functions and try implementing them in your own databases.
- Reading formulas and experimenting can lead to powerful implementations.
Formulas can significantly enhance database functionality and visibility, making Notion a more powerful tool for managing various tasks and projects.