Building a Habit Tracker in Roam Research
4 min read

Building a Habit Tracker in Roam Research

If you want your habits to stick, you need to track them.

James Clear mentions habit tracking as one way to stick with your habits in his book, Atomic Habits.

Making progress is satisfying, and visual measures—like moving paper clips or hairpins or marbles—provide clear evidence of your progress. As a result, they reinforce your behavior and add a little bit of immediate satisfaction to any activity. Visual measurement comes in many forms: food journals, workout logs, loyalty punch cards, the progress bar on a software download, even the page numbers in a book. But perhaps the best way to measure your progress is with a habit tracker.

Habit tracking allows you to reflect on your progress and even motivate you to keep going - the feeling of not wanting to kill the streak is natural!

While there are plenty of habit trackers out there, I use Roam for habit tracking. It makes it easy for me to look back at my habits and jot down notes on any habits I tracked, something lacking in most habit tracking apps. While most people use Roam for note-taking, I also use it for journaling, project management, and habit tracking. Shouldn't a second brain be able to store everything you need to retrieve?

There are two ways to achieve it in Roam; using tables and attribute tables.

Tables

A straightforward way to track your habits is by using the tables function. Simply hit / and pick table from the drop-down menu to make a table. From there, you can modify your table to include days and the habit you would like to track. You can do this every week or every month. It's simple to make one and is intuitive enough to use. Just tick off the days where you got the habit done.

Here's an example of a table for you to copy

- [[Habit Tracker Template]]
    - {{[[table]]}}
        - Habits
            - Mon
                - Tues
                    - Wed
                        - Thurs
                            - Fri 
                                - Sat
                                    - Sun
        - Sleep 8+ hours
            - {{[[TODO]]}} 
                - {{[[TODO]]}} 
                    - {{[[TODO]]}} 
                        - {{[[TODO]]}} 
                            - {{[[TODO]]}} 
                                - {{[[TODO]]}} 
                                    - {{[[TODO]]}} 
        - Read 20 pages
            - {{[[TODO]]}} 
                - {{[[TODO]]}} 
                    - {{[[TODO]]}} 
                        - {{[[TODO]]}} 
                            - {{[[TODO]]}} 
                                - {{[[TODO]]}} 
                                    - {{[[TODO]]}} 
        - Go for a walk
            - {{[[TODO]]}} 
                - {{[[TODO]]}} 
                    - {{[[TODO]]}} 
                        - {{[[TODO]]}} 
                            - {{[[TODO]]}} 
                                - {{[[TODO]]}} 
                                    - {{[[TODO]]}} 
        - Lift weights
            - {{[[TODO]]}} 
                - {{[[TODO]]}} 
                    - {{[[TODO]]}} 
                        - {{[[TODO]]}} 
                            - {{[[TODO]]}} 
                                - {{[[TODO]]}} 
                                    - {{[[TODO]]}} 
        - Turn off your phone when you work
            - {{[[TODO]]}} 
                - {{[[TODO]]}} 
                    - {{[[TODO]]}} 
                        - {{[[TODO]]}} 
                            - {{[[TODO]]}} 
                                - {{[[TODO]]}} 
                                    - {{[[TODO]]}} 

You can use Roam templates to duplicate your habit tracker when it’s time to make a new one instead of copying and pasting. Have a page where you keep all your habit tracking and favourite it for easy access.

Attribute tables

Another method for habit tracking is using attribute tables. Attributes are another way to invoke links in Roam Research, besides double brackets and tags. To create an attribute, write down the name of the page and type two semicolons after it. If I want to create a page named Habit Tracking, then I would type out Habit Tracking::

To track your habits, list down all the habits you want to track as attributes in a daily note. Create a new page for your habit tracker, which for the purposes of this tutorial, will be called Habit Tracking and be sure to list it on the same Daily Notes page as your attributed habits.

Then, simply write a note about whether you got the habit done or not after the two semicolons. Let's say, for example, today, I did 30 pages of reading, slept for 9 hours, and went for a 10 minute walk. I will fill in what did I do for that habit.

Every day, type in these attributes inside your Daily Notes page, and write down whether you got it done or not. You could use Roam templates to make it easy to duplicate these attributes into your Daily Notes page.

Next, go to your Habit Tracking page and create an attributes table. You can invoke an attribute table by typing {{attr-table: [[Insert one of the attributes from the relevant page]]}}.


Link to one of  the habits you want to track that you turned into attributes, and it will pull in other attributes that were on the same page and create a table for us.

The right-hand column will populate with the name of the page/block next up in the hierarchy.

The big advantage of using attribute tables is that we can add a note to our habit by nesting under it. This way, we can see more context and information about the habit we did on that day.

You can also use soft line breaks if you want to see the comment in the table.

Clicking the entries in the table will open it up on the sidebar, and you'll be able to check your comments. Notice how the nested comments are only visible when you click on the entries? The table is simple to look at, but you can get more context by nesting comments under your entry.

Use the method that works for you; the trick is to make it easy to track your habits. While Roam is fantastic for this, using habit tracking apps, spreadsheets, or even pen and paper can track your habits too!

Enjoying these posts? Subscribe for more