📹 Video - My approach to using Obsidian tags to implement GTD® contexts

2 min read (465 words)

I have further improved my Obsidian vault to allow me to find the right tasks at the right moment, for example when I'm at the shops, or using my laptop. It is simple as using Obsidian's native tag capability to add a #context/shops at the end of a task, and then adding a simple "DataviewJS" query on a page to make them easily findable when I need them.

I've taken the time to record a quick demo, take a look here:

thumbnail of youtube vid

You can find the demo vault used in the video on github, including the "contexts" page that has the dataview query to retrieve context tags and their incomplete tasks

Here's the DataviewJS query for showing the context tags on an Obsidian page:

const tags = Object.keys(app.metadataCache.getTags())
  .filter(tag => tag.startsWith("#context/"))
  .sort();

const vault = app.vault.getName();

const links = tags.map(tag => {
  const label = tag.replace("#context/", "");
  const query = `task-todo:${tag}`;

  const url =
    `obsidian://search?vault=${encodeURIComponent(vault)}` +
    `&query=${encodeURIComponent(query)}`;

  return `[${label}](${url})`;
});

dv.list(links);

Tweet This || Post to LinkedIn || Page Source

Subscribe for updates on software development, contracting, side projects, blog posts and who knows what else. Read the archives for an idea of content.

Mailing list powered by the excellent buttondown.email.