Get AI summaries of any video or article — Sign up free
Notion Formulas 2.0 – Advanced Masterclass thumbnail

Notion Formulas 2.0 – Advanced Masterclass

Thomas Frank Explains·
5 min read

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.

TL;DR

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?

Formulas 2.0 can treat data as a list (array) and transform it step-by-step. After mapping a relation into a list of view counts, sort orders the list numerically, reverse flips it to highest-to-lowest, and slice(0, 3) returns only the first three items. This creates a pipeline where each stage returns a new list for the next stage.

How does map turn a relation of pages into a list of view counts?

Map takes the “videos” relation list and applies a function to each element. Inside that function, current refers to the page currently being processed. By accessing current.views (or the equivalent property), map returns a new list containing the view count from every related video page.

What’s the purpose of let/lets when using find after mapping and slicing?

After slice produces top view counts, the formula must locate the matching pages in the videos relation. find also uses its own current, which would otherwise point to the relation page being searched rather than the top view value being matched. let/lets stores the map’s current view count in a variable (e.g., currentCount), so find can compare current.views to that stored value reliably.

Why is regex replace used to truncate titles, and how does it avoid cutting words in half?

Titles are truncated using replace with a regular expression that captures the first ~25 characters (using a capture group like (.{0,25}...)). To avoid splitting words, the pattern is adjusted to match word characters up to the next space or punctuation (using \W and quantifiers like +). The replacement uses the capture group (e.g., $1) so the output keeps a consistent length and ends cleanly at a word boundary.

Why doesn’t comma formatting rely on Notion’s numeric formatting, and how does the formula add commas anyway?

When view counts are combined with emojis/styling, the values are coerced into text, so Notion’s numeric formatting doesn’t reliably insert thousands separators. The formula uses replace with regex anchored to the end of the string (via $) to insert commas for thousands and millions. It uses capture groups to reassemble the number with separators and includes extra replace logic to handle cases below 1,000 and above 1 million.

How does the formula produce clickable links to both YouTube and Notion pages?

For YouTube, it uses link(video.url) where video.url comes from the related page’s URL property. For Notion pages, it builds a string containing the page ID (from a formula property like ID that returns the page ID) and wraps it with link(...). This yields a small page icon that jumps to the corresponding Notion record.

Review Questions

  1. In what order do sort, reverse, and slice need to run to reliably produce the top three videos by view count?
  2. How do current and let/lets interact when map produces view counts and find must match them back to pages?
  3. What regex techniques are used to truncate titles without splitting words, and to insert commas based on string position?

Key Points

  1. 1

    Formulas 2.0 introduces list/array operations that enable multi-stage pipelines using sort, reverse, and slice.

  2. 2

    Use map with current to extract properties (like views) from every page in a relation into a new list.

  3. 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. 4

    Render top results as a single formatted output by combining join (with \n) and style, then building clickable links with link().

  5. 5

    Truncate long text reliably using replace with regular expressions and capture groups, including patterns that stop at word boundaries.

  6. 6

    Add thousands/millions separators with regex when values become text due to styling or emoji concatenation.

  7. 7

    The same list/map/variable approach generalizes to other dashboards, such as computing “sales by day of week.”

Highlights

List functions plus method chaining turn Notion formulas into a pipeline: map → sort/reverse → slice → find → render.
Variables (let/lets) are the key to making find work after map, because current has different meanings in each nested operation.
Regex isn’t just for validation here—it’s used for both UI polish (title truncation) and numeric formatting (commas) when values become text.
Clickable Notion links can be generated by linking to a page ID string, enabling “jump back” workflows from dashboards to source records.

Topics

Mentioned