Can I reference a note in YAML and call a condition based on that YAML data when making a dataview TABLE?

I’m trying to create a system where I have a “document” note template with metadata for documents that I add to my database. For a TLDR use case: I want to maintain an index for documents relevant to case files. So for example, if I receive a contract from a lawyer, I put that in the database and reference the case note in the YAML of a “document” note along with date received and links to that item and the enclosing email (I’m open to other ideas for doing this; maybe even not in obsidian). I have a note for each “File” that I have open, and I wanted to filter by that note name in a dataview query if possible, by referencing that note in the YAML metadata. But I can’t figure it out!

Things I have tried

I created a “documents” folder and a “document” template the following YAML metadata

File: [[<name of file note]]

I’ve figured out how to make a table of all documents in the “documents” folder. But I can’t figure out how to filter by “File” in the YAML. Is there a special way to refer to a note name as YAML metadata? I’ve reviewed the dataview documentation but I only find queries based on folders, text and tags as YAML metadata.

Two possible options is to have a tag for each File note and call that, or represent the note as a string, but I would like to know whether I can just use a note name as a YAML variable and call that in a dataview query as a filter.

Thanks! Also open to any other suggestions. But that said, I thought it would be nice to have an index of documents exchanged right in my Case File notes.



What I’m trying to do

The basic problem: wrong syntax for note links in frontmatter.

key: "[[mynote]]"


TABLE file.cday
WHERE key = [[mynote]]

For query place in the note [[mynote]]

TABLE file.cday
WHERE key =
1 Like

Wow! Thank you!!

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