Empty [[]] is a handy self-reference

I accidentally discovered that in dataview
WHERE contains(propertyname, [])
will return a simple list of backlinks where the link is in that property called propertyname. But the main advantage over just looking at backlinks is that
TABLE propertyname
will show ALL the links in that property! My use case is the Template for Author contains such a dataview. Files created with the template will list not only Books written by the author but will also show any co-authors.
Using [] (empty double brackets) is a handy short cut so you don’t have to manually insert the name of the file into the dataview code. I couldn’t find this handy self-reference feature in any help documentation. May I suggest it be added?

2 Likes

Hi @BratschePlumb,

You can find [[]] and a few other helpful literals documented in the Dataview documentation under the Literals → General section.

Thank you Craig for the link showing that it is in fact documented. But don’t you think that location is rather obscure? Who would think to look in a list of literals when they are learning how to reference files? Since this feature could be quite useful I think it should be mentioned in a usage guide location.

For instance in the main introduction to dataview in the description of “contains” the example is given WHERE contains(authors, “Robert Lamb”). That could be immediately followed by the example WHERE contains(authors, []) for a concise table of back links from the “authors” property that could also show other properties.