Obsidian
Back to Knowledge
ObsidianAdvanced15 min

Obsidian Dataview Plugin Guide: Query Your Notes with DQL and Dynamic Tables

What Dataview Does for Your Vault

Dataview is the most powerful plugin in the Obsidian ecosystem. It turns your static notes into a queryable database — list notes by tag, sort by date, build tables of related content, and create dynamic dashboards that update automatically.

This guide covers DQL (Dataview Query Language) from basic LIST queries to inline JavaScript.

Installing & Enabling the Plugin

Install Dataview from Obsidian's community plugins:

Tip: Enable "Enable JavaScript Queries" in Dataview settings if you want to use the full JS API later. Keep it disabled initially for safety.

Writing Your First DQL Query

DQL has four query types: LIST, TABLE, TASK, and CALENDAR. Start with the simplest:

```dataview
LIST
FROM #concept
SORT file.mtime DESC
LIMIT 10
```

This lists the 10 most recently modified notes tagged #concept. Key syntax:

Dynamic Tables in Practice

Build a dashboard note that summarizes your vault:

## Recently Created
```dataview
TABLE file.ctime as "Created", file.tags as "Tags"
FROM "10-notes"
SORT file.ctime DESC
LIMIT 5
```
## Tasks This Week
```dataview
TASK
FROM "10-notes"
WHERE !completed AND file.ctime >= date(today) - dur(7 days)
GROUP BY file.link
```
## Orphan Notes (no links)
```dataview
LIST
FROM "10-notes"
WHERE length(file.inlinks) = 0
```

Inline JS & the Dataview API

For complex logic, use the Dataview JS API:

```dataviewjs
const pages = dv.pages("#project")
.where(p => p.status == "active")
.sort(p => p.priority, "desc")
dv.table(
["Project", "Priority", "Status", "Due"],
pages.map(p => [p.file.link, p.priority, p.status, p.due])
)
```

Query Errors & Debugging

Dataview troubleshooting:

Beyond Static Notes

Dataview opens up a world of possibilities:

← PreviousZellij Terminal Workspace Guide: Layouts, Panes, and the Modern Tmux AlternativeNext →Neovim LSP Setup Guide: Autocomplete, Diagnostics, and Code Intelligence in Terminal