Obsidian Bases filter not working? 12 fixes that actually work
If your Base is showing your entire vault or zero results, do not start with guesswork. Start with 2 questions:
- Is my filter in the right scope?
- Is the base evaluating the file and property types I think it is?
If you want the full system view first:
- Obsidian Bases pillar page
- Bases Debugging Cheat Sheet
Screenshot: the Filter menu with "All views" and "This view" visible side by side. This matters because scope confusion is the fastest explanation for the majority of "filter not working" reports.
First: confirm what "not working" means
If the Base shows EVERY file
A base without filters shows all files in your vault. Official: Views
So either:
- you have no dataset filter, or
- you added a filter to a different view than the one you are looking at
If the Base shows ZERO files
Usually:
- your filter is too strict, or
thisis pointing at a different file than you think, or- your comparisons are mismatched (link vs string, list vs scalar)
90-second fix: add a Debug view
Screenshot: a Debug view with
file.path,file.folder,file.tags, andfile.linksvisible. This matters because the fastest way to fix a base is to make the hidden metadata visible before you touch the logic.
Add this temporary view so you can see reality:
views:
- type: table
name: Debug
order:
- file.path
- file.folder
- file.ext
- file.tags
- file.links
limit: 200
File properties are documented here: Bases syntax (file properties)
Now you can answer:
- Are the files in the folder I think they are?
- Do they actually have the tag I am filtering for?
- Are they Markdown files (
file.ext == "md")?
Fix 1: Use the correct filter scope (All views vs This view)
Bases lets you apply filters to:
- All views (global dataset)
- This view (a slice)
These scopes are described in Views
Most reliable pattern:
- Put the dataset definition in global
filters - Put slice logic in the view
filters
Example:
filters:
and:
- 'type == "task"'
views:
- type: table
name: Today
filters:
and:
- 'due && due.date() == today()'
Fix 2: Quote filter statements in YAML when you hand-edit
The official examples often omit quoting, but quoting is a safe practice when you hand-edit YAML because it prevents parsing surprises.
Official schema: Bases syntax
Copy/paste safe style:
filters:
and:
- 'file.inFolder("Meetings")'
- 'status != "Done"'
Fix 3: Use the right folder scoping function
Folder scoping is typically done with file.inFolder().
Official: Functions
Copy/paste:
filters:
and:
- 'file.inFolder("Projects")'
Fix 4: Folder was renamed, and your filter did not update
This is a real-world failure mode: renaming folders does not automatically update base folder filters.
See: Changing folder name does not updated Bases or workspaces and Moving or renaming bases folder does not update the bases filter
Fix: Edit the filter manually and update the folder name.
Fix 5: Use file.hasTag() for actual file tags
If you want tags in content + frontmatter, use file.hasTag().
Official: Functions
Copy/paste:
filters:
and:
- 'file.hasTag("project")'
Fix 6: Do not confuse tags.contains() with file tags
tags.contains("x") checks a frontmatter property named tags.
It does not mean "all tags in the file."
This difference is clarified here: Nested tags support clarification
If you meant file tags, switch to file.hasTag().
Fix 7: this changed meaning when you embedded the base
this is context-sensitive:
- opened base:
thisrefers to the base file - embedded base:
thisrefers to the embedding file - sidebar base:
thisrefers to the active file in main content
Official: Bases syntax (this)
Quick "this test" filter:
filters:
and:
- 'file.path == this.file.path'
If this matches the wrong file, your base is in a different context than you assumed.
Fix 8: Use file.hasLink(this.file) for backlinks-style queries
The docs mention this pattern explicitly as a backlinks-like use case.
Official: Bases syntax (hasLink example)
Copy/paste:
filters:
and:
- 'file.hasLink(this.file)'
Fix 9: Link vs string mismatch (the silent killer)
If your property stores links, comparing it to a string will not match.
Bad pattern:
- 'list(attendees).contains(this.file.name)'
Better pattern when attendees is a list of links:
- 'list(attendees).contains(this)'
list() and contains() are documented: Functions
Fix 10: List vs scalar mismatch (property is sometimes a list, sometimes one value)
Normalize with list().
Official: Bases syntax (list())
Copy/paste:
filters:
and:
- 'list(attendees).contains(this)'
Fix 11: Date filters: use today() and date() correctly
Date arithmetic and today() are documented here: Bases syntax (date arithmetic)
Copy/paste: due today
filters:
and:
- 'due && due.date() == today()'
Copy/paste: due in next 7 days
filters:
and:
- 'due && due <= today() + "7d"'
Fix 12: Reduce to a minimal repro base
If you still cannot tell what is wrong, remove everything and add one filter at a time:
views:
- type: table
name: Minimal
filters:
and:
- 'file.ext == "md"'
order:
- file.path
limit: 50
Then add:
- folder filter OR type filter
- then tag filter
- then the complex logic
Related reading
- Obsidian Bases pillar page
- Bases Debugging Cheat Sheet
- Advanced filter patterns
- Tags in Bases: file.tags vs tags property
- Bases syntax YAML reference
- Date filters and recurring windows