Skip to main content
When you create a base in Obsidian, it is saved as a .base file. Bases are typically edited through the app interface, but you can also edit the underlying syntax directly or write it in a base code block embedded in a Markdown note. Bases syntax is YAML-based. Filters and formulas share the same expression language.

Complete example

Here is a fully configured .base file:

Sections

filters

The filters section narrows which files the base includes. Without filters, a base shows every file in your vault. Filters can be applied at two levels:
  1. Global — under the top-level filters key. Applies to all views.
  2. Per-view — inside an individual view’s filters key. Applies only to that view.
Both levels are combined with AND when evaluating a view.
A filter statement is any expression that evaluates to truthy or falsey for a given file. This includes comparisons and function calls.

formulas

The formulas section defines computed properties available across all views:
Formulas are stored as strings in YAML. Use nested quotes for text literals. A formula’s output type is determined by the data and functions used — formulas are not constrained to strings at runtime. Reference property types in formulas:

properties

The properties section stores display configuration for properties:
Display names are used in column headers and UI labels. They are not used in filters or formulas.

summaries

The summaries section defines custom summary formulas. In the values expression, values is a list of all values for that property across every row in the result set:
Default summary formulas are also available without defining them here:

views

The views section is a list of view configurations:

Properties in bases

Bases work with three types of properties:

Note properties

Stored in the YAML frontmatter of Markdown files. Access with property_name or note.property_name:

File properties

Built-in properties available for all file types:

this — context-aware file reference

Use this to reference the file where the base is displayed:
  • Opened as a file: this refers to the .base file itself.
  • Embedded in a note: this refers to the embedding note.
  • In a sidebar: this refers to the active file in the main content area.
Example — replicate the backlinks panel:

Operators

Arithmetic

Comparison

Boolean

Date arithmetic

Add or subtract durations from dates using string suffixes:
Subtracting two dates returns the difference in milliseconds.

Types