Using Dataview to find notes that have meta data with a link

What I’m trying to do

I have a meeting note where I have a property called Projects (i.e. a field using the properties feature) (which is a list property type) and in that I have a field value which is a link to another note (i.e. a project note which has filename “:hammer_and_wrench: Project”.

I want to run a query in the project note that retrieves the meeting note.

Things I have tried

My query looks like this:

TABLE 
WHERE Projects = "[[🛠 Project]]"
SORT file.name desc

I’ve tried removing “”, removing the spacing, using contains etc and can’t get it to work.

Any help would be much appreciated.

1 Like

I got this to work by removing the quotes:

TABLE
WHERE Projects = [[🛠 Project]]
SORT file.name desc

However, my metadata was set up like this:

---
Projects: "[[🛠 Project]]"
---

I then tried it again with my metadata formatted like this, and it didn’t work:

---
Projects:
  - "[[🛠 Project]]"
---

So using “=” just doesn’t work for list properties like that, I s’pose.

Here’s the solution that should work for you:

TABLE
WHERE contains(Projects, [[🛠 Project]])
SORT file.name desc

Again, Dataview appears to not need the quotes around the string.

Thank you so much @solarboi - the solution you suggested works! I’ve spent so long trying to figure it out. Really appreciate it.

1 Like

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