Dataview - Search for notes without specific Metadata


I am currently transitioning from using Notion and I need help with searching for notes that do not have a specific MetaData Field.

I’m currently using Dataview to search for notes where the “Folder” and “Environment” fields have a specific value (“WIP”). This works for notes that were created using a template that I set up. However, I sometimes create notes outside of the template and forget to set the metadata fields.

So my question is, how can I search for all notes that do not have the “Folder” and “Environment” fields at all.

Here’s the Dataview code that I’m currently using to search for notes that have the “Folder” and “Environment” fields set to “WIP”: (default by Template)

FROM "Notes"
WHERE Folder = "WIP"
Environment = "WIP"

Searching for notes not having a field, might result in very large results, as they potentially can list all other files in your vault. With that being said, I think something like !Folder or !Environment should do the trick, so maybe something like:

TABLE Folder, Environment
FROM "Notes"
WHERE !Folder OR !Environment

I’m listing the fields as columns, just so that you’re able to detect if it’s just one or both which are missing.

As easy as that! I must have missed this in the docu that you can just use “!” for this.

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