How to use Dataview to make a list of notes with certain tags, but ONLY if those notes have a backlink containing a certain string?

Hey!

Be so, so grateful for some help…

I’m looking to scour my vault for notes regarding unfinished projects relating only to our house. In my vault, project notes always have a checkmark emoji (:ballot_box_with_check:︎) in the filename, and all house notes have a diamond (◇) in the filename. And any project relating to the house will always have a backlink to the area of the house in question

i.e the link [[:ballot_box_with_check:︎ Decorate hall with panelling]] will live in [[◇ Hall]].

So far I’m getting all my unfinished projects listed nicely via this:

LIST
FROM #to/finish
WHERE contains(file.name, "☑︎") 

But this obviously also contains work projects and other unrelated projects to the house. If I could filter it to ONLY show those projects that had a backlink with the character (◇) in it, I’d be all sorted. I’ve tried all sorts of nested WHERE and CONTAINS instructions, but I’m getting a little lost.

Can anyone kindly tell me what I should try?

Thanks!

I’m not sure if I understand… (my bad, English isn’t my native language).

So, your start query is:

LIST
FROM #to/finish
WHERE contains(file.name, "☑︎") 

Now you want to filter the results: only files with a backlink containing ◇ in the filename…
Backlinks are inlinks to your notes. Let’s try something like:

LIST
FROM #to/finish
WHERE contains(file.name, "☑︎") 
WHERE contains(file.inlinks.file.name, "◇")
2 Likes

Hey! Genius! Works a treat. Thanks so much for your help - really appreciated!!

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