Transcript for:
Guide to Notion Formula Updates

Notion formulas just got a whole lot simpler, easier and fun to play around with. This video will walk you through all the new Notion formula changes and show you how to create a habit tracker, a project overview, and a financial summary even if you're a complete Notion noob. This will be part one of a three-part Notion Formula series. So, make sure to check out part two after this video. And with that out of the way, let's get started. The first major change is that Notion formulas now also support dates, people, lists, and page data types instead of just text, numbers and checkbox values. When referencing a new property in your formula, you'll no longer see that long prop function but instead just a property name with a gray background. Though when you copy and paste the formula onto a code block or want to share with others, you'll notice it still uses the prop function but it's just displayed differently in the editor. In the formula editor, you can now press Shift+Enter to create multiple lines, use step to create line indentations, and, use the forward slash and asterisk to add comments in your formula just like with coding. This alone makes formulas a lot easier to use and understand, but then on top of this we also get the dot notation. Instead of adding a function in the beginning of the formula and then having to close it off at the end, we can now simply write out our formulas from left to right by adding a dot. The old way still works as well but the dot notation is so much easier and cleaner. Another change is that your formula won't update until you click done, which is why you also got this previous section at the bottom. And when you make changes to your formula, you'll now see this revert button next to done, which will undo all of your recent changes. where the part in your formula that the error message is referring to will now be underlined with red. And the last change is the ability to now wrap Notion formula properties. So when your formula is long or goes across multiple lines like this one, you need to go into the database menu and under layout, turn on the wrap all columns option. And now with all the changes out of the way, let's get started with some examples and go through all the new Notion formulas. Just note that the formulas we don't cover in this video will be covered in Part 2 and Part 3, which you can find linked in the description below, along with the Life OS dashboard, which I'll be using throughout this video. So be sure to check the description. Let's start things off with the formula used in my Life OS Habit Tracker. In my Dynamic Habit Tracker videos, you'll notice I use the unaryPlus function to turn a checkbox property into a number value. However, that function is now removed and instead we'll be using the toNumber function. Before this update, the formula would have looked something like this where everything is in one line and the functions are in the beginning with closing brackets at the end. But now with formulas 2.0, we can just select the property we want and then add a dot to add our function. In this case, that would be our habit checkbox and then the to Number function. And then when we add a plus, we can Shift+Enter and press tab to add the next part of our formula whilst keeping everything nice and clean. So for this habit tracker, we're just going to continue until all of our habits are added, and then put everything inside of brackets and divide it all with the total number of habits we have as well as add a round function at the end to remove any decimals. Now we can click done, edit the formula property, select the percentage as the format and select the progress bar or the progress ring. And if everything is entered in correctly, you now should have a working habit tracker. Now let's move on to possibly the most important new functions to build something that wasn't possible before this update. Our next formula will show an overview of the total completed and uncompleted tasks for each of our projects, and this is all just one single formula with no rollups. So to create this, we're first going to create ourselves a new project and add a couple of tasks to that project. Then we're going to click inside the project and add a new formula property and call it project overview. For this formula, I'm going to use six new functions that you yourself, will also probably use very often. The first new function I'm going to introduce is the map function. This allows you to use information from related databases, just like rollups, except it's inside a formula and you can do so much more with that information. Let me show you. For this formula, we want the total completed and uncompleted tasks. So we're going to start with the map function, select our relation property to the task database, and then add a comma and select the current function. Now, if we click done, you'll see that we have a list of all the tasks relating to this project and we can actually click on them and they will open up as their own page. Though for this formula, we want to use the checkbox property. So what we're going to do is next to current, add a dot and then select the property that we want to use, which in this case would be the Done checkbox property. And now in the preview, you'll see instead of a list of all the pages, we have a list of all the checkboxes. Now in order to get the number value, we're going to use a new function called filter. And, inside the filter brackets, we're going to add our filter criteria. We're going to select our current function, which is our Done checkbox property and that it needs to equal true, aka, the checkbox needs to be checked. Now as you'll see in the preview, we only have checked checkboxes, but this is still not a number. So, let's get the total number of checked checkboxes by adding another new function called length to the end of the formula. Now that we have our formula for calculating the total completed tasks, I want to introduce another very important function that you'll also use a lot, which is called lets. Lets allows you to replace long functions just like this one with one word that you can use throughout your formula. Let me show you what I mean. For the lets function, the first bit of text will be your placeholder. I'm just going to use the word completed tasks. Then I'm going to add a comma, followed by the formula, which in this case is the one we just created. So I'm just going to cut and paste this in and then add another comma to close it off. And because we're using the lets function, and not just let, we can add another variable. So, while we're at it, let's create one for our uncompleted tasks as well by copying and pasting this formula, changing the variable text, changing the checkbox criteria to false, and then adding another comma to close it off. Normally, you'd start off with the lets function. First create all your variables, and then build out your formula. But the only reason I introduced lets a bit later is simply for the sake of the video. Now that we've set our variables, we can use them in our formula. So let's first do the completed section by using the completed variable, adding a plus, and then inside of quotation marks, add a space, and then our completed tasks text. When we click on done, you'll see everything working perfectly. Now before we add in our uncompleted section, we need a line break so the two formulas are on top of each other, instead of next to each other, which brings us to the next new function. On a new line, we're going to add a plus, then inside of quotation marks, add a backslash, enter letter "n" followed by another plus. Now that we've got our line break, we can add our uncompleted tasks variable, a plus, and then inside of quotation marks, the text "uncompleted tasks" with a space in front. Now if we click on Done, you'll see both of them are on top of each other. But if we go back to our dashboard, you'll see the texts next to each other. So to fix this, just go into your database menu, and then under layout, select the wrap all columns option. Since our formula is now getting longer, I'm going to start adding comments to each section, just to make things a bit more organized. Now you might notice that if there is just one task, it still says tasks, plural, instead of just task, singular. So what we need to do to fix this, is just create a quick if statement that says if our completed tasks is one, then show completed task, otherwise show completed tasks. So basically we're just removing the s from the tasks, if there's only one. And then we'll also do the exact same with the uncompleted tasks. If we click on done, you'll see that we now got text that says task, if there's only one, and tasks, if there's more than one. Now with that done, we just need to add the overview text on top of the completed tasks, so we're going to create a new section with a comment, add in the overview text inside of quotation marks with a colon. And then in order to style the overview text, we're going to introduce a new function called style. When you're hovering over the style function, at the bottom you'll see a window showing all the different variables that you can use to style your formula. For this one, we're simply going to make it bold and change the color to green. So inside of the style function, we're just going to add in b inside of quotation marks, add a comma, and then add in the word green also inside of quotation marks. And then also just make sure to add another line break underneath the overview text. And there you go. If you followed each step correctly, you now got a project overview that updates automatically as you complete your tasks. Next, I'm going to show an example of how to create a financial summary formula. Inside my Life OS Finance Tracker, there's a summary database that will automatically show the total income, expenses and profit as you add new income or expenses to your finance tracker. However, if you click inside of this database, you'll see that it requires 12 properties to function. We've got four properties for the text, four properties for the amounts, and four properties for the space in between. But now with formulas 2.0, we can condense all of that into one single formula. I'm not going to be typing out the formula from scratch but will walk you through how it works. At the top, you'll now recognize the lets function where I created the variable for the total income, expenses and profit. The income and expenses is simply a sum function on the income and expense amount property from the related finance tracker database. And then the profit variable is just those two subtracted from each other. For the total income section, we have a text with a style function to make it bold, underline it and change the color. Then we have a line break followed by the dollar symbol and our total income variable with the format function to change the number format into a text. And then there is this complicated replace function, which I won't be going into depth now, but it's basically just to add a comma after the initial three, six and nine zeros. So this formula will only work for numbers smaller than a billion. So sorry to all those billionaires watching my videos. You'll just have to use the normal rollup property. But for the rest of us, I don't think we need to worry about that just yet. Then after the numbers, it's a line break, a space inside of quotation marks, and then another line break. Then it's pretty much the exact same thing for all the other sections, except for the last one where it shows the total profit in your native currency. So all we're doing here is just multiplying the total profit with the exchange rate of our native currency to the US dollar. And then also adding the symbol of our native currency to the front. Now if we click on Done, we can go to our gallery view database, hide our 12 properties and then show our new formula. Now, with this formula as well, just make sure that the columns are wrapped. Otherwise, the text will be next to each other instead of on top of each other. Make sure to check out the Life OS dashboard used in this video, as well as the second part of this formula series, which will be on the screen now, and also linked in the description. Oh, and also like the video.