.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:
- Global — under the top-level
filterskey. Applies to all views. - Per-view — inside an individual view’s
filterskey. Applies only to that view.
AND when evaluating a view.
formulas
The formulas section defines computed properties available across all views:
| Type | Syntax | Example |
|---|---|---|
| Note property | property or note.property | price |
| File property | file.name, file.size | file.mtime |
| Another formula | formula.name | formula.ppu |
properties
The properties section stores display configuration for properties:
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:
| Name | Input type | Description |
|---|---|---|
| Average | Number | Mean of all values |
| Min | Number | Smallest value |
| Max | Number | Largest value |
| Sum | Number | Total of all values |
| Range | Number | Difference between max and min |
| Median | Number | Median value |
| Stddev | Number | Standard deviation |
| Earliest | Date | Oldest date |
| Latest | Date | Most recent date |
| Range | Date | Difference between earliest and latest |
| Checked | Boolean | Count of true values |
| Unchecked | Boolean | Count of false values |
| Empty | Any | Count of empty values |
| Filled | Any | Count of non-empty values |
| Unique | Any | Count of distinct values |
views
The views section is a list of view configurations:
| Key | Description |
|---|---|
type | Layout type: table, list, cards, map |
name | Display name for the view. Used to select a default view when embedding. |
limit | Maximum number of rows to display. |
filters | View-specific filters (same syntax as global filters). |
groupBy | Property and direction to group results. |
order | List of property names defining column order. |
summaries | Map of property names to summary formula names. |
Properties in bases
Bases work with three types of properties:Note properties
Stored in the YAML frontmatter of Markdown files. Access withproperty_name or note.property_name:
File properties
Built-in properties available for all file types:| Property | Type | Description |
|---|---|---|
file.name | String | File name including extension |
file.basename | String | File name without extension |
file.path | String | Full path relative to vault root |
file.folder | String | Path to the parent folder |
file.ext | String | File extension |
file.size | Number | File size in bytes |
file.tags | List | Tags including inline tags |
file.links | List | Internal links within the file |
file.ctime | Date | Creation timestamp |
file.mtime | Date | Last-modified timestamp |
file.properties | Object | All frontmatter properties |
this — context-aware file reference
Use this to reference the file where the base is displayed:
- Opened as a file:
thisrefers to the.basefile itself. - Embedded in a note:
thisrefers to the embedding note. - In a sidebar:
thisrefers to the active file in the main content area.
Operators
Arithmetic
| Operator | Description |
|---|---|
+ | Add |
- | Subtract |
* | Multiply |
/ | Divide |
% | Modulo |
( ) | Parentheses (grouping) |
Comparison
| Operator | Description |
|---|---|
== | Equals |
!= | Not equal |
> | Greater than |
< | Less than |
>= | Greater than or equal to |
<= | Less than or equal to |
Boolean
| Operator | Description |
|---|---|
! | Logical not |
&& | Logical and |
|| | Logical or |
Date arithmetic
Add or subtract durations from dates using string suffixes:| Unit | Accepted formats |
|---|---|
| Year | y, year, years |
| Month | M, month, months |
| Day | d, day, days |
| Week | w, week, weeks |
| Hour | h, hour, hours |
| Minute | m, minute, minutes |
| Second | s, second, seconds |
Types
| Type | Notes |
|---|---|
| String | Enclosed in single or double quotes: "hello", 'world' |
| Number | Written as digits, optionally in parentheses: 1, (2.5) |
| Boolean | true or false (no quotes) |
| Date | Created with date(), today(), or now() |
| List | Access elements with property[0] (0-based index) |
| Object | Access values with property.key or property["key"] |
| Link | Wikilinks in frontmatter are automatically recognized; construct with link("path") |