DataView query to extract part of a note

What I’m trying to do

I am tagging lines in my notes with a specific tag, in this case #reflections. Would like to have a query that can show those lines to me in a list of table view. It is easy to match the notes that have this tag and get a link, but I don’t want to click into a note to see the related content, want it to be shown in a summary page.

To provide an example, here is a sample note:

  • this is some general text in my note that is not relevant to the topic I’m interested in.
  • this item talks about something to reflect on and I would like this to be visible in a separate page with all other similarly tagged items. #reflections

Things I have tried

The following dataview query will show all files that have the #reflections tag.

TABLE file.cday as Created, file.mday as Modified, file.content as Content
WHERE contains(file.tags, “#reflections”)

The file.content reference here is not useful since it just shows a dash ‘-’.

Seems like I could do this with dataviewjs but that might not be particularly performant as I would be parsing through every markdown file in my vault.

Any suggestions?

check out

there are multiple user scripts which can be used or with some work tweaked to suit your needs

or just

see this thread

Thanks @Yurcee , appreciate the links. As suspected, this is all done with dataviewjs. I will do some testing and see how well it performs as I may be discounting it prematurely.

in the second link, you can specify custom folder

otherwise, yeah, we would need a native way to query for content and be able to copy the texts to further manipulate it

In your example the content you’re looking for is actually in a list. If that’s always the case then you could access the content through flattening file.lists.

1 Like

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