Progress Bar
Notion’s formula code is very scary at first. But today I make it simple.
In this issue, I’ll create the first part of a super simple progress bar, that’s super quick to build and will expose you to some basic ways to utilize Notion’s formula property.
Also, just wanted to say thank you to Notion for these free gifts!
Tutorial
Let’s say that I want to track 5 habits everyday. To make this progress bar, I create 5 checkboxes for 5 habits. I then title each of them the name of the respective habits.
Then I will create a formula property called % value. The goal of this property will be to see what percentages of the checkboxes are actually checked.
So how do we do that? First of all we want to count how many checkboxes out of 5 are checked. so for example if 4 are checked, we should have the number four.
Next, let’s click into the formula property and start working with our Notion’s code.
This line of code below sees if “Daily Workout” is checked. If it is marked, it will return the number 1, if not, it will return 0.
(prop("Daily Workout") ? 1 : 0)
If I change the title of “Daily Workout” to “Wake Up 9 AM”, it will instead see if “Wake Up 9 AM” is checked, and, again, will return 1 if it is, and 0 if it’s not.
(prop("Wake Up 9 AM") ? 1 : 0)
I then add 5 instances of this code for all 5 habits together, which is shown below.
(prop("Daily Workout") ? 1 : 0) + (prop("Read By 11:30 PM") ? 1 : 0) + (prop("Wake Up 9 AM") ? 1 : 0) + (prop("Finish Daily Tracker") ? 1 : 0) + (prop("Complete All Tasks") ? 1 : 0)
As a result, if I check 4 boxes it will return 1 + 1 + 1 + 1 + 0, which is 4. If I check 3 boxes, I will get 1 + 1 + 1 + 0 + 0, which is 3.
For sake of simplicity, I just multiplied the amount of marked boxes by 20. Since there are 5 total boxes, each check should make % value go up by 20. The code for this is shown below.
((prop("Daily Workout") ? 1 : 0) + (prop("Read By 11:30 PM") ? 1 : 0) + (prop("Wake Up 9 AM") ? 1 : 0) + (prop("Finish Daily Tracker") ? 1 : 0) + (prop("Complete All Tasks") ? 1 : 0)) * 20
A more comprehensive way would be to divide the number of checked boxes by the total amount boxes, then multiplying by 100. There’s countless ways to do this, so feel free to change it up however you want.
With the percentage value, you can literally make a progress bar of any size and with any design. Next week I’ll go over a few more powerful Notion commands that’ll enable you to build any kind of bar you want.
Conclusion
This is just the tip of the iceberg. With even just a little of Notion’s low-code knowledge, you can create solutions far beyond just tracking habits.
If you enjoyed this issue, feel free to hit the heart button. If you’re new and enjoyed this issue, feel free to hit the subscribe button below and get a free template of my base all-in-one Notion workspace. Thanks again for everyone’s support; it inspires me every day to write!