Transcript for:
Notion Formulas 2.0: Overview and Applications

notion has just improved their formulas big time they call it formulas 2.0 and in this video I'm gonna show you first was changed and then how I'm using it for my business to give you a little bit of an idea how you can use it yourself let's get into it the first and what for me is the biggest change about is that now motion formulas can output reach content what do I mean by this we are no longer just outputting text numbers or a checkbox a Boolean we can now output pages yes you are right if you see here this is a Formula that I'm gonna dive into it a little bit later and all of these are Pages within the formula that if I just click on it I go to the actual page another thing that's changed now formulas can be much more readable I don't know if you remember with some very long formulas that you need to squint your eyes to really see what was going on there like so many parentheses it was impossible to debug I was actually using a different editor because I was getting crazy but now it is so much easier why let me show you because now the formula editor really behaves as a real code editor and we can have line breaks that we can create with shift enter and it doesn't affect the formula at all we can add comments so the comments have to be within these two symbols the forward slash star star star forward slash even the comments can be multi-line until we close it and what's also even cooler is that now we can use indentation on text in the formula so if I just select all of this and press the tab this guess indenting and it can be intended forever like this we can make everything so much more readable another big change is what they call the dot notation so if before we had a formula like this sum and then within the formula we have the arguments of the formula I mean if you wanna know which are the arguments you can just click there and see them there and this will return six so it's the sum of these three but now with DOT notation we can write the same formula in a different way we can first write the argument and then the function that we want to apply to this argument for such a simple example doesn't really make sense but once we get to the more complex formula that I have below you will see how this is more helpful than not and since I have understood how this works because it took me a little bit this is the only notation that I use right now is so much more comprehensible and we will see why in a minute another change that I also love you remember when you had a mistake in a formula that you were writing and you didn't really know where the mistake was so all you got was the errorism character 1273 who knows where that is so now we have a proper error feedback now we have the error underlined by this red line so we can actually know that the error is there and it also explains you what's going on okay but now we have the underline so this makes debugging formulas more complicated formulas so much easier again now some things to also take into account if we modify what is inside of our formula let's say I had a 4 here the result is just gonna be updated in here but not here if we want it to be really updated in all the database we have to click on done or come on enter this another small change apart from all these changes notion hustles have been working very hard because we've been working with them for over a month in creating new functions for the formulas now I'm gonna show you the ones that I've been using a lot in which I think are the most helpful but I would recommend you to just open a formula property click on it and just scroll down to see everything that they have so now let me put you what I think is one of the best examples that I can put to show you all the new functions that exist the ones that I think are most helpful in everything that I've been talking about so let's say that we have a project that is linked to all these tasks and what we want is to have like a mini dashboard on how this project is doing so how the hell I'm doing this let's open the formula and let's go step by step understanding what it's doing so here with comments I'm saying that this is part of the not started piece and this part of the in progress piece so on the first part we have the the title and there is something new here we can style text and this is done with this style function you see I'm using here a DOT notation and this is a string of text that if I add this dot style I can actually style it you can see here everything that is available for styling and I have decided to make it bold and to turn it red like this is visible and then what am I doing I'm using a new function which is the filter the way this is working is I'm taking the tasks relational property from here and with the turn notation I'm filtering it if we go to the filter we can see that after the first argument which in our case is the tasks because we're using the denotation we need to reference this argument with the word current and what I want to filter is the status that is not started because what I'm getting at is to count how many not started tasks are there in this case three so I'm filtering all the tasks that have the status not started and then I'm calculating the length of this array okay because all of this is going to return an array of tasks an array is basically a list and I'm with this formula I'm counting the length of the text or List value okay so this is the three and then I'm doing the same for all tasks there is no filter here so here I'm just counting all tasks which in this case is five we can see the five over here now how am I creating this beautiful list of notes started here in the new formulas we can also add these characters and these characters to create a breakline which is this one new line or a tabulation which is this one over here so this brake line corresponds to this and then we are building this list of tasks how we are doing it this first arrow is this first arrow and then the same as before tasks filter the current status is not started I'm sorting it alphabetically this is not really necessary but now probably you are starting to see why am I using the dot notation because it is so much easier to just add functions on top of each other and then you don't you don't have to keep track of all the parentheses that you've opened because then you have to close them and everything becomes so much harder to read to me it's so much easier to say okay I have the tasks I want to filter them by the status I wanna install them and one to them join them okay it is so much easier to to read as well so yes I'm sorting them alphabetically and then what I'm doing is I am adding in between each task this is what the join function is do it is doing we get a list which is our our tasks filtered and I'm joining them with whatever I'm writing inside of the join function which in my case is a new line a tab and an arrow so this is from here it will be a new line a tab and the arrow and then I'm gonna write the next task and then I join them to the next item in the list with a new line Tab and arrow okay so this is what this is doing and then I go on to build the impropriate there is a plus button uh there is a plus sign over here that then is adding this piece of text which is this one I'm not going to explain it because it's the same as before and then the same I'm filtering the task but but the status is in progress and I'm sorting them their filter and as I showed you before all these tasks are completely clickable so this simple example you can extrapolate to so many other things you can hear all the information that you want for example who is working on what so instead of the statuses it will be Daniel is working on this Peter is working on that for even next to the test we could add how long we've been working on it or where did when the task was created or we can even group the task by created time like we can do so many things so we can have an overview of everything that's going on in this case in our projects so now let's see another example that is also going to introduce us to something new that notion formulas has so let's say that we have a client and the client always pays us at the same time every month and we know when was the first time that he's paid us and we want to have a formula always to know when the client is going to pay us next like this we can forecast the cash flow that is going to come into our company so how am I doing this with this formula over here here I introduce a new function which is let what this does is declaring a variable that then we can reference later in the formula what do I mean by this so here I'm using let and I'm creating this variable called date I can choose whatever then I'm telling the formula what date means or what date is in this case I want that date is a date and this brings us to the second new formula that is also super useful because this is going to allow us to create real dates properties from a formula we have parse date now so as we can read here if we pass the parse date function a string that looks like this it turns it into a real date output which we can then filter as a date known as a string of text so with this I'm constructing a date so how am I doing it I'm using the Now function and Dot notation here so this is giving me the current year then I'm adding The Hyphen because it is important that it's in this format and then I'm getting here the month in this way with format date now and in this notation so I can get it like this so this is the current month and then another hyphen and then the project start date but only the days so in this current scenario now we are in August 2023 so the output of this will be 2023 because it's the current year will be 0 8 which is August and will be only the date of the start date which is seven so it will be August 7 2023 I mean Canada so this is the date okay and now I'm using the date variable inside of a formula after this comma so now if the salary sees that the deal is closed this doesn't really make sense in this example and so if now so the current time is greater than date than all of this then what I want to return is date which is again all of this so now you are seeing why this is helpful because I'm using date so many times and if I wouldn't have used the lit I will be writing all these over and over so if now is greater than date then I add one month and if not then I just return date so what am I achieving with this so I'm just always setting this as the current year and month and I'm just taking the date into consideration so if that date in the past I have to add one month because the person has already paid me this month and if the date is in the future I just keep it as is because he still didn't pay me in this month and this is what we are doing so now how is this working if I set this to I don't know May 10th so this September 10th and if I set it in the future a little bit so this is today's August 25th on the 30th then it's August 30th it doesn't add that extra month another example that I love and that it's is nothing new we have already covered it but is the yes the styling is this formula over here this is basically counting how long I've been working on a task depending on when I started it and this is a Formula over here it may seem a little bit complicated but with all these comments it's quite easy to understand so what it does is being worked on I don't need to get into it but for me what is cool is just the the studying it just gives so much more pleasure to see these uh with colors than than just with with simple white text so so yeah we can we can also play with the with the setting to make our formulas look so much better so I know that in formulas I mean it's it's infinite the amount of things that we can do with them these have been the two examples with all a little meat inside of them that I have found the most useful but now feel free to experiment see all the formulas that notion has to offer read them all and then try to implement them yourself in the beginning it took me a little while to really understand them but once I got them then I realized how powerful they can be so that is it for the video guys and as always [Music]