| name | obsidian-bases |
| description | Create and edit Obsidian Bases (.base files) with views, filters, formulas, and summaries. Use when working with .base files, creating database-like views of notes, or when the user mentions Bases, table views, card views, filters, or formulas in Obsidian. |
Obsidian Bases Skill
Workflow
- Create the file: Create a
.base file in the vault with valid YAML content
- Define scope: Add
filters to select which notes appear (by tag, folder, property, or date)
- Add formulas (optional): Define computed properties in the
formulas section
- Configure views: Add one or more views (
table, cards, list, or map) with order specifying which properties to display
- Validate: Verify the file is valid YAML with no syntax errors. Check that all referenced properties and formulas exist. Common issues: unquoted strings containing special YAML characters, mismatched quotes in formula expressions, referencing
formula.X without defining X in formulas
- Test in Obsidian: Open the
.base file in Obsidian to confirm the view renders correctly. If it shows a YAML error, check quoting rules below
Schema
Base files use the .base extension and contain valid YAML.
filters:
and: []
or: []
not: []
formulas:
formula_name: 'expression'
properties:
property_name:
displayName: "Display Name"
formula.formula_name:
displayName: "Formula Display Name"
file.ext:
displayName: "Extension"
summaries:
custom_summary_name: 'values.mean().round(3)'
views:
- type: table | cards | list | map
name: "View Name"
limit: 10
groupBy:
property: property_name
direction: ASC | DESC
filters:
and: []
order:
- file.name
- property_name
- formula.formula_name
summaries:
property_name: Average
Formula Syntax
Formulas compute values from properties. Defined in the formulas section.
formulas:
total: "price * quantity"
status_icon: 'if(done, "✅", "⏳")'
formatted_price: 'if(price, price.toFixed(2) + " dollars")'
created: 'file.ctime.format("YYYY-MM-DD")'
days_old: '(now() - file.ctime).days'
days_until_due: 'if(due_date, (date(due_date) - today()).days, "")'
Key Functions
Most commonly used functions. For the complete reference of all types (Date, String, Number, List, File, Link, Object, RegExp), see FUNCTIONS_REFERENCE.md.
| Function | Signature | Description |
|---|
date() | date(string): date | Parse string to date (YYYY-MM-DD HH:mm:ss) |
now() | now(): date | Current date and time |
today() | today(): date | Current date (time = 00:00:00) |
if() | if(condition, trueResult, falseResult?) | Conditional |
duration() | duration(string): duration | Parse duration string |
file() | file(path): file | Get file object |
link() | link(path, display?): Link | Create a link |
Duration Type
When subtracting two dates, the result is a Duration type (not a number).
Duration Fields: duration.days, duration.hours, duration.minutes, duration.seconds, duration.milliseconds
IMPORTANT: Duration does NOT support .round(), .floor(), .ceil() directly. Access a numeric field first (like .days), then apply number functions.
Date Arithmetic
"now() + \"1 day\""
"today() + \"7d\""
"now() - file.ctime"
"(now() - file.ctime).days"
YAML Quoting Rules
- Use single quotes for formulas containing double quotes:
'if(done, "Yes", "No")'
- Use double quotes for simple strings:
"My View Name"
- Escape nested quotes properly in complex expressions
- Strings containing
:, {, }, [, ], ,, &, *, #, ?, |, -, <, >, =, !, %, @ must be quoted
Reference Docs
External Links