1. Displaying the Most Recent Database Entry and its Properties [0]

thumbnail This section explains how to use Notion formulas, specifically the `let`, `find`, and `map` functions, to display information from the most recent entry in a related database.

1.1. The Value of Showing Recent Entries [0]

  1. This technique is useful when you have many related database entries and want to see specific information, like a property or status, from the very latest entry based on time. [1]
  2. This can be based on any time-related property, such as a date property, creation date, or last edited time. [1]

1.2. Setting Up the Formula with let [6]

  1. The let formula function is used to define variables, which saves time and effort by allowing you to reuse complex formulas or terms. [6]
  2. A let formula starts by defining a variable name, followed by the variable's value, and then the output that uses that variable. [9]
  3. For example, defining recent as 5 and then outputting recent results in 5. [10]

1.3. Finding the Most Recent Entry with find and map [11]

  1. The find formula function is a new tool that helps match an array or relation to specific criteria. [12]
  2. To find the most recent entry, you can use the find function on a relation (like "tasks") and set a condition where the current date of a task matches the most recent date available in that relation. [13]
  3. Previously, last and sort functions were used for this, but they can now be applied within a map formula to match criteria. [15]
  4. The process involves mapping the tasks and their dates, sorting them to find the last (most recent) condition, and then using find to locate that specific entry. [17]
  5. This formula effectively finds the related task whose date is equal to the most recent date. [23]

1.4. Demonstrating the Formula's Functionality [19]

  1. When a task's date is June 8th, it is recognized as the most recent entry. [19]
  2. If a task's date is changed to May 28th, the formula quickly updates to show June 1st as the most recent entry. [20]

2. Displaying Additional Properties of the Most Recent Entry [24]

thumbnail This section details how to extend the formula to display other properties from the most recent database entry, such as an AI summary, by leveraging the variable defined in the `let` function.

2.1. Adding More Properties to the Output [24]

  1. After defining the most recent entry using the let formula, you can reference any of its properties for the output. [29]
  2. To add another property, like an "AI summary," you can include a line break (\n) in the formula output. [25]
  3. This line break separates the name of the most recent task entry from its AI summary, creating a cleaner presentation. [25]
  4. The formula can be updated to include the AI summary as an additional output after the name of the most recent task. [30]

2.2. Formatting and Verification [31]

  1. The formula output includes a clickable link to the most recent entry, which can be expanded to verify the displayed information. [31]
  2. Adding more line breaks can further enhance the formatting and spacing between different pieces of text in the output. [33]
  3. This approach allows you to display the name of the entry and any other related property that can be defined within the formula. [34]