Obsidian - Getting Started with Dataview
Based on Josh Plunkett's video on YouTube. If you like this content, support the original creators by watching, liking and subscribing to their content.
YAML front matter (“top matter” between triple dashes) stores human-readable metadata that Dataview can query.
Briefing
Dataview turns an Obsidian vault into a queryable database by letting notes pull structured data from front matter and other files—then render the results as inline text or automatically generated tables. The payoff is practical: instead of retyping the same attributes across multiple places (especially in TTRPG workflows), users can store facts once in YAML front matter and have Dataview populate character sheets, wiki-style info boxes, and encounter planning views on demand.
The foundation is YAML front matter (the “top matter” section between triple dashes). Values stored there become variables—essentially named boxes holding data. Dataview’s inline expressions then inject those variables directly into the body of a note using syntax like “this.<variable>” (e.g., pulling a player’s name, race, class, or level into a template). In the TTRPG example, an info box is filled automatically from metadata fields, saving time and reducing copy/paste errors. The transcript also highlights multi-variable stacking (pulling multiple fields into a single rendered area) and encourages template-driven setups so users don’t have to memorize syntax.
From there, Dataview expands beyond front matter with inline JavaScript expressions (“inline JS”). Unlike inline expressions that mainly work with vault files and their variables, inline JS can pull in other computed values—such as the current time, the current file name, or the file path—demonstrating that Dataview can blend note metadata with dynamic logic. For deeper automation, Dataview query blocks generate tables by scanning a chosen folder and filtering results based on metadata.
The core query workflow is demonstrated by building a table of players from a specific folder (e.g., a party directory). The query defines the table columns (class, race, level, etc.) and filters notes by metadata such as role equals “player.” The transcript also contrasts equality filtering with substring matching using “contains,” noting that large queries can noticeably impact performance—sometimes causing the system to pause while results are processed. The practical guidance: keep queries scoped, avoid “return everything in the vault” patterns, and reuse templates for common query types.
Finally, Dataview JS queries show the most DM-friendly power: querying external JSON data used by TTRPG stat block tooling. A specialized example uses a stat block plugin’s data.json (and related initiative tracker data) to filter monsters by name content (e.g., “kobold”) and render a table with fields like HP, AC, attack/CR, and source. A key detail is linking: using dv.fileLink with monster.name creates clickable links to corresponding monster notes, even though the JSON itself doesn’t contain the note content—notes must exist separately for links to resolve. The result is a searchable, up-to-date monster roster that can feed encounter prep and reduce reliance on static “monster manual” style duplication.
Overall, Dataview’s value comes from combining front matter variables, inline expressions, query tables, and JS-powered access to structured data—while managing performance by limiting query scope and leaning on templates for repeatable syntax.
Cornell Notes
Dataview for Obsidian lets users treat a vault like a database: YAML front matter becomes queryable variables, inline expressions inject those values into notes, and Dataview query blocks generate tables from sets of notes. Inline JS expressions extend the system with computed or external values like current time, file name, and file path. For TTRPG use, Dataview queries can build player tables from folders by filtering metadata (e.g., role equals player or using contains). Dataview JS queries can also pull monster data from a stat block plugin’s data.json and render DM-facing tables, including clickable links via dv.fileLink when corresponding monster notes exist. Because large queries can slow or lock up the vault, scoping queries and using templates is strongly recommended.
How do YAML front matter variables become usable inside notes with Dataview?
What’s the difference between inline expressions and inline JS expressions in Dataview?
How does a Dataview query block generate a table from notes?
When should a user use “contains” instead of “equals” in Dataview queries?
How can Dataview JS queries power TTRPG monster tables, and what role does dv.fileLink play?
Why do large Dataview queries sometimes slow down or freeze Obsidian?
Review Questions
- If a note’s YAML front matter includes role: player, how would a Dataview query filter to include only those notes?
- What are three kinds of values the transcript claims inline JS expressions can return that inline expressions can’t reliably provide?
- In a Dataview JS monster table, why might dv.fileLink create a broken or missing link for a monster name?
Key Points
- 1
YAML front matter (“top matter” between triple dashes) stores human-readable metadata that Dataview can query.
- 2
Inline expressions inject front matter variables into note text, enabling templates that auto-populate repeated fields like race, class, and level.
- 3
Inline JS expressions add dynamic or computed values such as current time, file name, and file path beyond simple metadata substitution.
- 4
Dataview query blocks generate tables by scanning a chosen folder and filtering notes using metadata conditions like role equals player or contains-based matching.
- 5
Large Dataview queries can noticeably slow or lock up Obsidian, so scoping queries and avoiding “return everything” patterns matters.
- 6
Dataview JS queries can pull monster data from a stat block plugin’s data.json and render DM-facing tables, including clickable links via dv.fileLink when matching monster notes exist.