Notion Formulas 2.0 – Advanced Masterclass
Based on Thomas Frank Explains's video on YouTube. If you like this content, support the original creators by watching, liking and subscribing to their content.
Formulas 2.0 introduces list/array operations that enable multi-stage pipelines using sort, reverse, and slice.
Briefing
Notion’s new “formulas 2.0” language unlocks list-based programming inside Notion—letting users sort, slice, map across related pages, and even build multi-step pipelines that were effectively impossible with formulas 1.0. The practical payoff is a fully dynamic “Top 3 videos” block that pulls view counts from a relation, ranks the results, and then renders a styled, link-rich output (YouTube links plus Notion page links) with truncated titles and properly formatted numbers.
The masterclass starts by contrasting formulas 1.0’s limitations with formulas 2.0’s biggest upgrade: list functions. Instead of treating data as single values, formulas 2.0 can create and manipulate lists (arrays). With method chaining (using dot syntax), a list can be piped through operations like sort, reverse, and slice to produce exactly the subset needed. The instructor demonstrates this with simple numeric lists first, then moves to a real Notion relation property called “videos,” which outputs a list of related video pages.
Sorting by view count requires more than sorting page titles. That’s where “map” becomes central. Map takes an input list and applies a function to every element, returning a new list. By mapping over the “videos” relation and using the keyword current to reference each page in turn, the formula can extract each page’s views into a list of view counts. Once those counts are in a list, sort and reverse can order them from highest to lowest. Slice then trims the list down to the top three values.
The next challenge is turning those top view numbers back into the actual video pages. Because sort can’t accept custom criteria, the formula uses another list operation—find—to locate the first related page whose views match each value from the top-three list. This is where formulas 2.0’s “let” (and its multi-variable cousin “lets”) matters: variables prevent repeated code and resolve a tricky scoping issue where find has its own current. With let/lets, the formula stores the current view count being processed and compares it against each candidate page’s views inside find.
From there, the output becomes a creator-friendly dashboard element. The formula builds a structured string per video: a clickable YouTube link, a clickable Notion page link (using a page ID formula property and the link function), and a styled view count. It also uses join with “\n” to ensure each video renders on its own line, and style to apply code-like formatting and bolding.
To make the display readable, the formula truncates long titles using replace with regular expressions and capture groups—matching the first ~25 characters without cutting words midstream. Finally, it formats view counts with commas. Since the views are coerced into text when combined with emojis/styling, built-in numeric formatting doesn’t reliably apply, so the formula uses replace and regex patterns anchored to the end of the string (via $) to insert thousands and millions separators, including edge cases for values under 1,000 and over 1 million.
The session closes by pointing to a growing Notion formula reference on ThomasJFrank.com (migrated to formulas 2.0) and mentions that the same list/map/variable techniques power another example: “sales by day of week,” which uses mapping and filtering logic to compute totals and format them for display. The broader message is clear: formulas 2.0 turns Notion formulas into a practical, code-like data transformation tool for real dashboards and templates.
Cornell Notes
Formulas 2.0 adds list/array capabilities to Notion formulas, enabling operations like sort, reverse, and slice, plus “map” to run logic across each item in a relation. Using map with current, the formula extracts view counts from a “videos” relation, sorts them, and slices to the top three. Variables via let/lets solve scoping issues when “find” must match those top view counts back to the correct related pages. The final output is a styled, multi-line string that includes clickable YouTube links, clickable Notion page links, truncated titles via regex replace, and comma formatting for view counts using regex because values become text when styled.
Why do list functions (sort/reverse/slice) matter for building a “top 3” ranking in Notion?
How does map turn a relation of pages into a list of view counts?
What’s the purpose of let/lets when using find after mapping and slicing?
Why is regex replace used to truncate titles, and how does it avoid cutting words in half?
Why doesn’t comma formatting rely on Notion’s numeric formatting, and how does the formula add commas anyway?
How does the formula produce clickable links to both YouTube and Notion pages?
Review Questions
- In what order do sort, reverse, and slice need to run to reliably produce the top three videos by view count?
- How do current and let/lets interact when map produces view counts and find must match them back to pages?
- What regex techniques are used to truncate titles without splitting words, and to insert commas based on string position?
Key Points
- 1
Formulas 2.0 introduces list/array operations that enable multi-stage pipelines using sort, reverse, and slice.
- 2
Use map with current to extract properties (like views) from every page in a relation into a new list.
- 3
Use let/lets to store intermediate values so find can correctly match mapped results back to the right related pages despite scoping conflicts.
- 4
Render top results as a single formatted output by combining join (with \n) and style, then building clickable links with link().
- 5
Truncate long text reliably using replace with regular expressions and capture groups, including patterns that stop at word boundaries.
- 6
Add thousands/millions separators with regex when values become text due to styling or emoji concatenation.
- 7
The same list/map/variable approach generalizes to other dashboards, such as computing “sales by day of week.”