How to extract tagged lines from files to assemble them in a single page?

As I am trying to converge on the best way to use Obsidian, I am trying to use daily notes and tag some of the lines for reuse, e.g.

ID of John: 2343
during military actions, sin(x) can be greater than 1
#todo repaint the house
#pro #todo install the new plugin

we need to investigate the use of Obsidian better #todo

I would like to build a dynamic page where all lines with #todo would be gathered in one place, in a dynamic page.

I had a look at Dataquery, but it seems that the sources are limited:

Dataview generates data from your vault by pulling information from Markdown frontmatter and Inline fields

My questions:

  • is there a way to extract lines with a specific tag? (JS is very fine for me)
  • is this the proper approach to such annotations (this question arose after reading another question and its answers)

Dataview (not Dataquery) works with metadata. But inside dataviewjs you can play with any js code and use dataview to output/render the results from any js code.

I’m not versed in JS, but I guess you need to create a code to explore the content of files via Obsidian api (app.vault.getMarkdownFiles() or using the dataview (, parsing the content with the regex help. But I imagine you can face performance issues…

The content of the bullet-point lists is metadata. Then, if you use this format, you can play only with dataview language without more complex js code.

But remember: these solutions produce dynamic results, not a static content. I.e., the outputted results doesn’t exist as md content.

This is not my work, but it’s something I use. It comes from a demo vault that can be found here: Dataview Example Vault

It will only return items from a list, not from a sentence.

TABLE L.text AS "My lists"
FROM "10 Example Data/dailys"
FLATTEN file.lists AS L
WHERE contains(L.tags, "#tag1")

See if the Tasks plugin will work for you? It can pull all blocks with a checkbox containing a certain tag, and lets you edit them with a dialog box. Not quite an “extract” but it could be useful.

Or, you could just try obsidian’s inbuilt query like so:

tag: todo

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.