Finding missing properties

What I’m trying to do

For a lot of notes I created properties like “beginner” with a value like 1025, and/or “advanced” with a similar numeric value. These properties I use for dataview queries to create a list of ordered topics for my courses. Since I started with that system when having a lot of notes already, I need to find all notes where I forgot to add one or both of these properties. Thanks for any solution.

Things I have tried

I searched this forum and the internet and experimented with dataview, based on code I found. Without luck. I’m able to write simple dataviews, but I don`t know dataviewjs.

If you’re comfortable using Dataview, you can use the following query:

```dataview
LIST WITHOUT ID file.name 
FROM ""
WHERE contains(file.frontmatter, "beginner")
  AND (beginner = null OR beginner = "")
```

This checks all files for properties, in this case beginner and if there is nothing after it (or empty "") then it’ll list the file.

Thank you very much. Will test it as soon as possible. It will be very helpful to get a consistency in my properties, in cases they exist already but have no value. That’s the case in my vault. So with your code I can find all notes that have a property like “advanced” that has no value.

That’s helpful. But what I really wanted to find out: how can I find all notes, that don’t have a certain property at all. I.e. all notes that don’t have the property “advanced”. I think your code could be adapted to that situation. How would I do that? Thanks!

Turn the AND into an OR:

```dataview
LIST WITHOUT ID file.name 
FROM ""
WHERE contains(file.frontmatter, "beginner")
  AND (beginner = null OR beginner = "")

Do you get what you want with:

```dataview 
LIST
WHERE !beginner AND !advanced 
```

This should show you all files where neither of those properties have a truthy value.

1 Like