Query all notes based on links to other notes #1296
-
Hi everybody, I can't create a query to output results based on the following scenario: Folder A has some notes linked to other notes in Folder B, Folder C, Folder D (a single note in Folder A can have multiple links to other notes in other folders) I would like to generate a list of notes in Folder A based on the links contained in the notes, for example: SELECT all notes FROM Folder A WHERE notes contain a link to Folder B Thank you for your help! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 11 replies
-
Check out the Edit: Typo fixed thanks to AB1908 comment below, thanks for catching that! |
Beta Was this translation helpful? Give feedback.
-
I know, it's a late reply: LIST
FROM "Folder A"
WHERE contains(file.outlinks.file.folder, "Folder B") |
Beta Was this translation helpful? Give feedback.
Check out the
file.outlinks
field. I think your query would be something likeLIST FROM "Folder A" WHERE any(filter(file.outlinks, (outlink) => contains(meta(outlink).path, "Folder B")))
but folks with more dataview experience might be able to get something more succinct. Functions reference forany
filter
contains
meta(link).path
Edit: Typo fixed thanks to AB1908 comment below, thanks for catching that!
Edit2: Thanks gbozzetti for catching another error!