Setting Up a Real-Time Task Manager in Obsidian

The objective of this blog post is to show you how you can set up a task manager monitoring system, per se, in Obsidian that allows you to be notified of tasks that are due on a certain date regardless of where they are created; that is to say, from a daily note, or an ad hoc note. For example, in this article, I’ll demonstrate the five-step process of setting up this system that displays a daily note and note generated from a meeting. Of course, to make this work, one must utilize date-stamping one’s notes and I’ll explain how this is done as well.

Before I reveal the five-step process for this, it’s important that you do some preliminary work in your Obsidian vault to get it prepared for operating as a task manager. There are three plugins that you should create and a fourth that I highly recommend in conjunction with the other three. These three plugins are: templates, daily notes, and dataviewjs. The first two are core plugins whereas the third is a community plugin. The fourth plugin that I alluded to earlier is calendar. This, too, is a community plugin. I find that working with the Obsidian calendar in conjunction with daily notes is essential in creating and viewing daily notes since these two plugins complement one another.

Enabling Required Plugins

Your first step, of course, is to create a blank Obsidian vault, which you should name appropriately for this project. I called my Obsidian vault, Task Manager. As a matter of convention, I create all of my Obsidian vaults in ~/Documents/My_Vaults in AVL-MXE 2021 Linux. After creating the vault and giving it an appropriate name, I set about enabling the necessary plugins. The first plugin is Templates. This is a core plugin, which does not require you to install anything. Simply go to Settings > Templates and after clicking on Templates, activate or enable it by clicking on the switch to the right (see the diagram below).

Templates Core Plugin Activation

Daily Notes is the second core plugin which you need to activate likewise as you did the Templates plugin. The third plugin is the community plugin called Dataview. You’ll need to install this plugin by navigating to the Community Plugins section and searching for Dataview. Once you locate it, click install to install it, and then enable to enable the plugin in Obsidian. And finally, install and enable the Calendar plugin as well as you did the Dataview plugin. There is an icon in the right-sidebar in the Obsidian main screen which opens and closes the Calendar. Now that we have the preliminary items taken care of, let’s proceed with the five-step process in this project.

Step 1: Create a Default Templates Folder

First, create a folder called templates, and then set it up as the default folder for templates in your Obsidian vault. This could be accomplished by clicking on New Folder, then naming the folder and sub-folder for housing your templates, then navigating to Settings > Templates and in the Template File Location field, typing the word templates. However, an easier way of accomplishing this is to type Ctrl + O (not zero) and in this window type: templates/daily to indicate that you wish to develop a daily template which will be placed in templates/daily (sub-folder).

Step 2: Create a Daily Template

Click the Daily sub-folder in the left side-bar and this will open a new note with the same name as this sub-folder. With the Daily note open, enter the following markdown code in that note:

# {{title}}

## Tasks due today

## Log

The {{title}} is a special markdown variable which creates the title based on the format of the filename which created it. Since we are creating daily notes, the title will be of the form YYYY-mm-dd; for example, 2022-04-20 as an H1 tag.

Step 3: Setting the Daily template as the Default Template Used in the Daily Notes

Now that we’ve created our Daily template in the format above, we need to tell Obsidian that this is to be the default template for every Daily Note that is created. How do we accomplish this? Well, this is quite simple. Navigate to Settings > Daily Notes and in the Template File Location field, type and select the template we created, which is templates/daily. If you created a Daily Note before setting up the template, then you’ll have to apply this template to it. To do that, open the Command Pane by typing Ctrl + P and typing in Insert Template. When this selection comes up, click on it and this will apply the only template (otherwise, if there were more than one template available, you would be asked which template to apply) to the Daily Note making it look like the following:

Applying default template to Daily Note

Note here that the Daily Note’s title is the formatted date for Daily Notes in Obsidian in the H1 tag presentation. At this point, if you open the Calendar and click on a specific date, say the 18th of April, then a note with the default template found in templates/daily will be automatically applied to it.

Step 4: Create Tasks

The purpose for creating tasks wherever you might be in Obsidian is to create that task on a Daily Note or other folder area that is applicable, such as Meeting, then tagging the note you create with a checkbox and the due date for that task. For example, if you were in a meeting for Project X and needed to take notes for week one of that project, you could setup a note by clicking Ctrl + O which allows you to type in: Meeting/ Project X – Week 1. Then, you could type in a header of meeting notes and create a checkbox entry using Ctrl + Enter followed by a space and the note itself. Of course, you’ll need to add a due date to this task and the way to accomplish this is to type [[2022-04-20]] which is markdown for a timestamp of 20 April 2022 and click out of this line or press Enter to start a new checkbox task item. See the image below for what that note contains and how it looks in Obsidian.

Checkbox Task Under Meeting Notes

Now, let’s return to today’s daily note and add a task there as well, This note, once created, looks like the following:

Checkbox Task For Today’s Daily Note

In this particular case, I set both due dates for 20 April 2022 so I would have two tasks to show later on.

Step 5: Using Dataviewjs To Pull In All Tasks Due on a Particular Date

We can use Dataviewjs to show us all tasks that are due on a particular date. To achieve this, we need to write out some java code that accomplishes this, which will display tasks due on a given date. You will need to make sure that Dataview is installed and enabled, which should have been accomplished in the preliminary workup prior to starting Step 1. Also, you’ll need to ensure that you enable JavaScript Queries in the Dataview plugin by selecting Dataview, then clicking the slider switch on the right-hand side. See the image below:

Enabling JavaScript Queries in Dataview

Now, we need to select the daily template file and in the Tasks due today section, write out the following code, which I will explain.


```dataviewjs
dv.taskList(dv.pages().file.tasks 
  .where(t => !t.completed)
  .where(t => t.text.includes("{{date:YYYY-MM-DD}}")))
```

We input this javascript code block by starting with three backtick marks, followed by dataviewjs, then type out the rest of the code as shown above. This code can be interpreted as follows: the code creates a task list of all the pages that have tasks but only ones where the task is not completed and where the text of the task includes the date. Then, on the next line, finish with another row of three backticks to close the code block. And, for the initial dataviewjs code block, we’re going to replace the {{date:YYYY-MM-DD}} with a hard coded date of {{2022-04-20}} for demonstration purposes since we have two tasks that we know have that date as due dates already setup in our Obsidian vault. Once we exit the code block in the Tasks due today section, the two tasks that we created should show up dynamically in the Java Code window with the task followed by the due date when those tasks are due. Take a look at the screenshot below:

Dynamic Java Code Display of Tasks Due Today

This represents what we see when the 20th of April 2022 arrives and two tasks are due on this date. When we complete one or both tasks, we can left-mouse click in the checkbox next to those tasks and the task will be removed from their respective areas automatically. By leaving the {{date:YYYY-MM_DD}} generic date field in the Java Code block, when a new Daily Note is created and tasks are created with future due dates, the date fields will be automatically entered so that you don’t have to manually enter them as we did in the hard coding of the date for demonstration purposes.

This is a fairly straightforward method for monitoring tasks in Obsidian using DataView, Daily Notes, Calendar, and Templates plugins.

Print Friendly, PDF & Email

Leave a Reply

Your email address will not be published.