= [[Link]].file.name does not work in WHERE contains()

For some reason, it is not possible to filter on the following query:
Inline DQL on note

Filter:: `= [[Kubernetes - Object]].file.name`

The query that needs to apply the filter looks as follows:

WHERE contains(file.name, [[]].Filter)
SORT file.name ASC

My notes have filenames as follows:
Kubernetes - Object
Kubernetes - Object Kind
Kubernetes - Object Kind - ConfigMap

I would expect the latter 3 results to appear in the dataview. However, the result is zero (0) records
If I replace the query to accept a plain string:

Filter:: Kubernetes - Object

The same query automagically starts working.

  • Kubernetes - Object
  • Kubernetes - Object Kind
  • Kubernetes - Object Kind - ConfigMap

Question is: Why can’t I use a [[link]] as Filter:: parameter.
Why? By doing so, it automatically adjusts when the note with the same name as the filter is renamed. Also, when changing the filter, one has the benefit of autocomplete.
Also, I’m curious why a [[link]] apparently is hard to change to a string. (Try string([[link]]) and find out it doesn’t seem to work)
Thanks, and help is appreciated.

A Dataview inline query only displays the query result, and you can’t use it to create something like a “dynamic inline field”. Metadata must be static.

In other words, Dataview parses metadata based on the actual/raw content of your note and doesn’t care what is displayed to you. You have to treat (1) what is written in your note and (2) what is displayed (i.e. rendered) to you separately.

Templater is different from Dataview in that it manipulates the actual note contents rather than appearance in a static manner.

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