Obsidian Bases
Workflow
- Read the existing
.basefile before editing it. - Define global scope with
filters. - Add computed values under
formulasonly when needed. - Configure property display names and one or more views.
- Validate YAML, formula references, quoting, and date/duration operations.
- Open or query the Base in Obsidian when the CLI is available.
Schema
filters:
and:
- 'file.ext == "md"'
- 'status != "archived"'
formulas:
days_until_due: 'if(due, (date(due) - today()).days.round(), "")'
properties:
status:
displayName: Status
formula.days_until_due:
displayName: "Days Until Due"
summaries:
mean_rounded: 'values.mean().round(2)'
views:
- type: table
name: Active
limit: 50
filters:
and:
- 'status != "done"'
order:
- file.name
- status
- due
- formula.days_until_due
sort:
- property: due
direction: ASC
groupBy:
property: status
direction: ASC
summaries:
formula.days_until_due: AverageViews may be table, cards, or list.
A map view depends on compatible map support.
order sets which properties a view shows; sort sets
row order, one property/direction entry per key,
applied in turn. Obsidian sorts only by properties that are also listed in
order, so include every sort property there.
Filters and properties
Filters may be a single expression or recursively nested and,
or, and not objects. Property namespaces are:
- note properties:
statusornote.status - file metadata:
file.name,file.path,
file.folder,file.ctime,file.mtime,
file.tags,file.links, and
file.backlinks - formulas:
formula.days_until_due
Use file.hasTag(), file.hasLink(),
file.hasProperty(), and file.inFolder() for indexed
file relationships. The this value refers to the Base itself, the
embedding note, or the active file depending on where the Base is rendered.
Formula rules
- Guard optional properties with
if(). - Date subtraction returns a Duration, not a number. Access
.days,.hours, or another numeric field before
calling number methods such as.round(). Round day counts:
across a daylight-saving change.dayscan be fractional. - Every
formula.Xused by a view or property configuration must
have a matchingXentry underformulas. - Wrap formulas containing double quotes in YAML single quotes.
- Quote YAML strings containing special characters, especially colons and
leading punctuation.
Read Functions reference for function and
type-specific operations, and Examples for complete
task-tracker and daily-notes Bases.
Validation checklist
- The document parses as YAML and has a
viewslist. - View
order,groupBy, and summaries reference defined
note, file, or formula properties. - Formula quoting is balanced and duration math accesses a numeric field.
- Every
sortproperty also appears in that view’sorder. - An embed names the view exactly as its
name:
![[My Base.base#view-name|View Name]]Attribution
Adapted from kepano/obsidian-skills at revision
a1dc48e68138490d522c04cbf5822214c6eb1202. See LICENSE.