TABLE WITHOUT ID link(file.name) AS "Taak", status AS "Status", prioriteit AS "Prioriteit", persoon AS "Persoon"
FROM "10 - Onderzoeken/Taken"
WHERE taaknr = [[Test]].onderzoeknr
SORT file.name ASC
Now I want to replace [[Test]] with the name of the note.
So that I don’t have to adjust this in every new note.
I’ve tried:
WHERE taaknr = [[file.name]].onderzoeknr
WHERE taaknr = tp.frontmatter.onderzoeknr
That is possible, but I have to do it again with every new note. What I’m trying to do is make it happen automatically when creating a new note. Via a template.
The syntax offered by Dataview can be used in a template and then applied (without modification being necessary) to new notes automatically. I use the code below, for example, in a people template to keep track of when I interact with different people. I don’t need to edit the code—the query works on the file name of the file it is used in.
```dataview
LIST
FROM [[]]
WHERE file.name != this.file.name
SORT file.link ASC
LIMIT 100
```
If I create a note called Seagram using this template, the file will populate with all file names of any notes that contain [[Seagram]]. I don’t need to edit the code; it’s all automatic. Not what you want?
No, not exactly. I have a note with a property called ‘onderzoeknr’. So what I want is that the ‘onderzoeknr’ is automatically filled in the dataview. In place of [[Test]].onderzoeknr position.
You want to filter a taaknr value that matches the file name of the file where the query is placed and the onderzoeknr of which file: the file that links to the file that has the query, or the file that the query is placed in?
So a taaknr is an always a combination of two pieces of metadata that match exactly?
taaknr = file name + onderzoeknr ?
Possible to share some sample YAML and a note of what the output should look like?