How to use tags in dataview

I’m trying to have a list of meeting notes that appear on a project page. I’m basing it on tags that in YAML in the note.

Here’s what I’ve tried

The YAML on the meeting note is:


Tags: ConnectHumanitySurvey
Type: Meeting

And I get an error free – but empty data view – with this:

list 
where Type = "meeting" 
where Tags = "ConnectHumanitySurvey"
sort "Last Modified"

Every fix I try just gives me a data view error. I can’t figure out what I’m doing wrong. I am confident it will be forward slapping simple though.

  • I don’t think you can have multiple wheres, but you can combine them into one.
  • Sorting by last modified goes like this: file.mtime desc (desc is for descending).

To combine both suggestions, this will probably work:

list
where Type = "meeting" and Tags = "ConnectHumanitySurvey"
sort file.mtime desc

If you want to have more than one tag, you’re gonna have to do things a bit differently. A field like that would be seen as a string, not a list. Instead, you define a list like this in the YAML of your notes:

Tags:
- Tag one
- Tag two

Or this:

Tags: ["Tag one", "Tag two"]

And then the query would look like this:

list
where Type = "meeting" and contains(Tags, "ConnectHumanitySurvey")
1 Like

Awesome! This worked. Thank you @input_sh!

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