Obsidian Bases
Create and manage database-like views of notes using Obsidian Bases, including the standardized Database/ folder schemas.
Quick Start
Create a base file
Use Command Palette → "Bases: Create new base" or right-click folder → "New base".
Basic structure:
filters:
and:
- file.inFolder("Database/Tasks")
- status == "active"
views:
- type: table
name: Active Tasks
order:
- priority
- due
Embed a base
Use ![[File.base]] or ![[File.base#ViewName]] in any note.
Inline base queries
```base
filters:
and:
- file.hasTag("example")
views:
- type: table
name: Results
```
Core Concepts
Properties
Three types of properties:
- •Note properties - Frontmatter YAML (access as
propertyornote.property) - •File properties - Built-in fields (
file.name,file.mtime,file.size, etc.) - •Formula properties - Calculated fields (
formula.formula_name)
Filters
Apply to all views or specific views. Use boolean logic (and, or, not):
filters:
and:
- file.inFolder("Database/Tasks")
- status == "active"
or:
- priority == "urgent"
- due < today()
not:
- assignee == null
Formulas
Define calculated properties:
formulas:
is_overdue: due && due < today() && status == "active"
days_until: 'due ? (due - today()).format("days") : ""'
price_total: "price * quantity"
Use in filters: formula.is_overdue
Views
Multiple views per base with different layouts:
- •table - Rows and columns (default)
- •cards - Gallery grid with optional images
- •list - Bulleted or numbered lists
- •map - Interactive map with pins (requires Maps plugin)
Database/ Folder Schemas
See references/database-schemas.md for complete property definitions and relationship patterns for:
- •Tasks - Task management (
status,priority,assignee,project,due) - •Projects - Project tracking (
lead,team,target_date, completion metrics) - •People - CRM contacts (
company,role,email, contact tracking) - •Companies - Organizations (
industry,stage,relationship) - •Meetings - Meeting notes (
attendees,meeting_date,project,company) - •Bookmarks - URL management (
url,category,saved,rating)
Common Patterns
Filter by folder and type
filters:
and:
- file.inFolder("Database/Tasks")
- type == "task"
Group by property
views:
- type: table
name: Tasks by Priority
groupBy:
property: priority
direction: DESC
Reference current file with this
filters:
and:
- project == link(this.file) # Tasks for current project
- file.hasLink(this.file) # Files linking here
Create relationships
# In task frontmatter assignee: "[[Database/People/Team-Member]]" project: "[[Database/Projects/AGI-Assistant]]"
Query related data:
filters:
and:
- file.inFolder("Database/Tasks")
- project == link("Database/Projects/AGI-Assistant")
Date arithmetic
formulas:
deadline: start_date + "2w"
is_overdue: due_date < now() && status != "Done"
days_ago: '(today() - file.ctime).format("days")'
Conditional display
formulas: status_indicator: 'if(completed, "✅", "⏳")' formatted_price: 'if(price, "$" + price.toFixed(2), "")'
List operations
formulas:
tag_count: tags.length
first_tag: tags[0]
has_urgent: tags.contains("urgent")
View Configuration
Table view
views:
- type: table
name: My View
limit: 50
order:
- priority
- due
groupBy:
property: status
direction: ASC
summaries:
file.name: Count
price: Sum
Cards view
views:
- type: cards
name: Gallery
cardSize: medium
imageProperty: cover
imageFit: cover
imageAspectRatio: "16:9"
List view
views:
- type: list
name: Task List
markers: bullets # bullets, numbers, or none
indentProperties: true
separator: ", "
Common Formulas
See references/formula-examples.md for extensive examples.
Quick reference:
# Date calculations
due_in_days: '(due - today()).format("days")'
overdue: due < today() && status == "active"
age_in_days: '(today() - file.ctime).format("days")'
# Text formatting
full_name: first_name + " " + last_name
display_title: file.name.title()
domain: 'url.split("/")[2]'
# Number calculations
total: price * quantity
percent: '(part / whole * 100).toFixed(1) + "%"'
# Conditional logic
priority_score: '(impact * urgency) / effort'
status_emoji: 'status == "done" ? "✅" : "⏳"'
Functions Reference
See references/functions-reference.md for complete function list.
Common functions:
Global: if(), now(), today(), date(), link(), max(), min()
String: contains(), replace(), split(), lower(), title(), trim()
Number: round(), ceil(), floor(), abs(), toFixed()
Date: format(), relative(), date(), time()
List: filter(), map(), sort(), join(), unique(), contains()
File: hasTag(), hasLink(), inFolder(), hasProperty()
Best Practices
File organization
- •Keep .base files in the folder they query
- •Use
Database/folder for centralized data - •Name files descriptively:
Tasks.base,Active-Projects.base
Property naming
- •Use lowercase with underscores:
due_date,last_contact - •Reserve
typefor entity classification - •Prefix formulas:
formula.is_overdue
Filter optimization
- •Apply folder filters at global level (applies to all views)
- •Apply specific filters at view level
- •Use file properties before note properties (faster)
Formula design
- •Keep formulas simple and readable
- •Use meaningful names:
days_until_duenotcalc1 - •Handle null values:
if(price, price.toFixed(2), "") - •Avoid circular references
View structure
- •First view is default when embedding
- •Name views descriptively: "Active Tasks by Priority"
- •Use grouping for categorical data
- •Add summaries for numeric columns
Syntax Reference
Operators
Arithmetic: +, -, *, /, %, ( )
Comparison: ==, !=, >, <, >=, <=
Boolean: !, &&, ||
Property access
property # Note property (shorthand) note.property # Note property (explicit) file.name # File property formula.calc # Formula property property.subprop # Object property (dot notation) property[0] # List element
Links
link("path") # Create link
link("path", "display") # Link with display text
link("path", icon("plus")) # Link with icon
assignee == link(this.file) # Compare link to current file
authors.contains(this) # Check if list contains link
Troubleshooting
Base not showing data
- •Check filter logic (use advanced editor to debug)
- •Verify folder paths are correct
- •Ensure property names match frontmatter
Formula not calculating
- •Check for circular references
- •Verify property types match operators
- •Use
if()to handle null values
View not updating
- •File properties auto-refresh
- •Note properties require file save
- •Backlinks may need manual refresh
Performance issues
- •Avoid
file.backlinksin formulas (expensive) - •Use
file.hasLink()instead of checking backlinks - •Limit results with
limitproperty - •Filter at folder level first
Migration from Dataview
Dataview query:
TABLE status, priority, due FROM "Tasks" WHERE status = "active" SORT priority DESC
Equivalent Base:
filters:
and:
- file.inFolder("Tasks")
- status == "active"
views:
- type: table
name: Active Tasks
order:
- priority
Key differences:
- •No
FROM- usefile.inFolder()filter - •No
TABLE- properties selected in UI - •
WHERE→filters - •
SORT→order - •
=→== - •Function syntax:
contains()notcontains
Additional Resources
- •Official Docs: https://help.obsidian.md/bases
- •Database Schemas - Complete property definitions
- •Formula Examples - Real-world formula patterns
- •Functions Reference - Complete function list