Dataview - filter by link?

Hello.
I created note with metadata. for examle:

---
Testtag: [[Test]]
---

and i try get all notes where Testtag=[[Test]]

list from "notes" where Testtag=[[Test]]

is not working. and:

list from "notes" where Testtag="[[Test]]"

doesn’t work either (Dataview: Query returned 0 results.)

how can i filter by link?

At this moment, for use of links in frontmatter fields quotation is required:

---
Testtag: "[[Test]]"
---

I got you fam!

What you need and I have no idea why this works but it does is the following dataview list:

```dataview
list 
from "notes" 
where contains(Testtag, "Test")

This will filter by link in your list.

Happy Obsing!

This query worked because you filtered the field “Testtag” with the command contains(): without quotation [[Test]] is read as a string and, with contains, the filter checks if “Teste” is a substring (i.e., inside) the string.
If you have this in other note…

---
Testtag: This is a Test
---

the filter selects this note as well… or “Testtag: [[This is another Test]]”…
Without quotation the field is read as a string and the results may not be the desired.

True amigo, I just tried that and it worked just like you said, darn, I thought I had a work around on my hands. Thank you for showing me this issue, this could be a real filter problem. I think I am going to go with your method too now.

Happy Obsing!

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