How to filter blank links in dataview?

Things I have tried

I’ve tried reading the dataview doc and searched the forums.

What I’m trying to do

I’m trying to list a field in my dataview table that has [[]] by default (when i create the file in templater) just to help me save time with having to type the brackets every time to link something. So for me, [[]] in this field means blank.

However, in dataview, all [[]] links to the file itself.
**I’m trying to either not display these, or display it as some default null / blank value. So, I only want to display in the column for that field, field values that are not [[]], or i.e. does not link to the file itself. **

When I write:
table filter(file.field, (i) => i != “[[]]”) as field
table filter(file.field, (i) => i != “[[]]”) as field
table filter(file.field, (i) => i != file.link) as field
It always returns null; if i try

table !filter(file.field, (i) => i = this.file.link) as field
And so on… it returns “true” always
(Field is a standin for my field name)

I’ve tried searching and it seems so basic, but I just haven’t been able to find anything about this [[]] link thing. Thanks so much.

This can be a good tactic to save some time but maybe not a good way in metadata sense.
But anyway. To start, any custom field (the created fields) don’t have the prefix file: file is the prefix related with implicit file metadata (file.name, file.link, file.tags, etc.). see docs
If you use

myField:: [[]]

you target it with myField (or myfield).

So, if you want to exclude the cases where the value is the “self” link, you can use this type of query:

TABLE myfield
WHERE myfield
WHERE myfield != file.link

Thank you! I have since stopped using the [[]] as you mention with the metadata issue. But that makes sense with file.link!

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