Dataview
Obsidian NPC tracker
Three setups, from thirty seconds to fifteen minutes. The third one answers questions you have not thought to ask yet — all the code is below, ready to copy.
“Wait — who was the blacksmith's sister?”
You invented her in session 6. You gave her a name. She had an opinion about the mayor. Now the party has tracked her down, five people are waiting, and you are scrolling a document hoping the name appears before the silence gets funny.
NPCs are the hardest thing to track because they multiply faster than anything else in a campaign and they arrive unplanned. You do not decide to add an NPC — a player asks the bartender's name and now you have one.
So the tracker has to be cheap to write to (three lines, mid-session, no ceremony) and instant to read from (one keystroke, sorted, filtered). Here are the three setups that do that, in order of effort.
Three ways to track NPCs
| Setup | Time | Holds up to | Gives you |
|---|---|---|---|
| 1. One note per NPC | 30 seconds | ~30 NPCs | Search and backlinks |
| 2. Properties + tags | 5 minutes | ~100 NPCs | Filtering by anything you record |
| 3. Dataview dashboard | 15 minutes | No practical limit | Live tables that answer questions mid-session |
They stack. Method 2 is method 1 plus frontmatter; method 3 is method 2 plus queries. Nothing you write early gets thrown away.
1Basic: one note per NPC
The whole method: every NPC gets a note in 02-Characters, named exactly as players say the name — Garruk Stonefist, not Garruk (blacksmith). Three lines is a complete note:
# Mara Vell
Half-elf fence in [[Oakhaven]], works out of the back of the pawn shop.
Wary, fast talker, owes [[The Quiet Hand]] a favour she resents.
First met in [[S06 - Recap]].
That is already more than most campaigns have. Because every mention is a link, Mara's note shows a backlink list at the bottom — every session and quest she appears in, maintained for free.
Where it breaks: around thirty NPCs. Search still finds a name you remember; it cannot answer "who is in Oakhaven that the party has met and is still alive". For that, the notes need fields.
2Properties and tags: make them filterable
Add a frontmatter block. Obsidian shows these as properties and — the part that matters — Dataview can query them later.
---
type: npc
race: Half-elf
role: Fence
location: Oakhaven
faction: The Quiet Hand
status: alive
met: true
campaign: The Missing Caravan
tags: npc
---
Six fields, fifteen seconds. The rules that keep it working:
- Identical field names on every NPC.
locationeverywhere — notplaceon some notes. A mismatched name is an invisible NPC. - Values match note titles.
location: Oakhavenwhen the note is calledOakhaven, so you can group and link on it. statusis worth it.alive/dead/missing. You will forget who died, and the party will not.met: trueis the sleeper field. It separates "NPCs that exist" from "NPCs the party can plausibly recognise" — which is the one distinction that gets embarrassing at the table.
With this in place, the sidebar search already does real work: tag:#npc "Oakhaven", or in the properties view, filter by faction.
3The NPC dashboard with Dataview
Install it once: Settings → Community plugins → Browse → "Dataview" → Install → Enable. Then make a note called NPC Tracker in 07-DM-Tools and paste the blocks you want. They re-run every time you open the note, so the tables are never out of date.
Every NPC, sorted by where they are
```dataview
TABLE race, role, location, faction, status
FROM "02-Characters"
WHERE type = "npc"
SORT location ASC, file.name ASC
```
Only the ones the party has actually met
```dataview
TABLE role, location, faction
FROM "02-Characters"
WHERE type = "npc" AND met = true AND status = "alive"
SORT file.name ASC
```
Grouped by faction — who works for whom
```dataview
TABLE rows.file.link AS "Members", rows.role AS "Roles"
FROM "02-Characters"
WHERE type = "npc" AND faction
GROUP BY faction
SORT faction ASC
```
The one that pays for itself: NPCs on a location note
Paste this into Oakhaven's note. Now the town note lists its own residents, and you never maintain that list — it builds itself as you write NPCs.
## Who is here
```dataview
TABLE role, faction, status
FROM "02-Characters"
WHERE type = "npc" AND location = this.file.name
SORT file.name ASC
```
this.file.name means the same block works unchanged on every location note. Put it in your location template once and every town you ever create has a resident list.
Loose ends: NPCs you created and never used again
```dataview
TABLE location, role, file.mtime AS "Last touched"
FROM "02-Characters"
WHERE type = "npc" AND status = "alive"
SORT file.mtime ASC
LIMIT 10
```
The ten NPCs you have not thought about in the longest time. Half of next session's plot is in that table — a forgotten NPC with an unresolved motive is a plot hook you already wrote.
Everyone who appears in a specific quest or session
```dataview
LIST
FROM [[The Missing Caravan]]
WHERE type = "npc"
```
FROM [[Note]] means "notes that link to this one", so this finds every NPC whose note mentions the quest. Drop it on the quest note itself with FROM [[]] — the empty link means "this note".
A headcount for the top of the dashboard
```dataview
TABLE length(rows) AS "Count"
FROM "02-Characters"
WHERE type = "npc"
GROUP BY status
```
Three rows — alive, dead, missing — and a number next to each. If you have Dataview's JavaScript queries enabled, the same figure inline reads $= dv.pages('"02-Characters"').where(p => p.status == "alive").length, which is handy in a sentence but needs that setting turned on.
Empty table? It is almost always one of these.
- The folder in
FROMdoes not match the real folder name — it is case-sensitive and needs the full path:FROM "02-Characters". - A field is spelled differently on some notes (
Locationvslocation). - The frontmatter is not the very first thing in the file — not even a blank line above it.
- You are in editing view. Dataview only renders in reading view (or Live Preview with the cursor outside the block).
met: trueis written asmet: "true"somewhere — quotes make it a string, and= truestops matching.
Keeping it fed without it becoming a chore
The tracker is only as good as the ten minutes after each session. The routine that works: during play, scribble names into your session note — no fields, no formatting. Afterwards, each new name becomes a note, gets its six fields, and gets linked from the recap. Three minutes for three new NPCs.
If that sounds like discipline you do not have, automate the typing instead: a Templater template means a new NPC is "new note → name → hotkey → fill three fields". The full campaign setup guide has that template, and the rest of the structure these queries assume.
Free resource
Get the dashboard pre-built
The free DM Quick-Start Vault ships with the NPC template, the folder it expects, and a DM Screen whose queries are already written and tested — including the NPC table above. Dataview is installed and enabled; there is nothing to configure.
- DM Screen dashboard (auto-updating Dataview tables)
- 3 templates: NPC, quest, session note
- Dataview + Templater pre-installed and configured
Download the free vault Name your price — $0 is fine. Delivered by email from Gumroad.
Done-for-you
QuestForge — the whole tracker, already wired up
The NPC table above is one of five on the QuestForge DM Screen — quests, NPCs, sessions, locations and factions, all live. Seven templates keep the fields consistent, and a fully linked example campaign shows you what a healthy vault looks like at session ten.
- DM Screen dashboardDataview tables that update themselves: open quests, NPCs, recent sessions, locations, factions.
- 7 templatesCampaign hub, NPC, location, faction, quest, session prep, session recap.
- 1 fully linked example campaign“The Missing Caravan” — learn the system by reading it, then delete it and start your own.
- 2 random tablesd20 “what’s in the room” and d8 “NPC first impression”, for when the players go sideways.
- Plugins pre-installed and configuredDataview + Templater are already in the vault. Unzip, click “Trust author”, done.
- Start Here onboardingA README and a walkthrough note that get you running in about two minutes.
- Lifetime updates + email supportOne-time payment. Every future version is yours.
Questions DMs actually ask
Do I need Dataview to track NPCs in Obsidian?
No — a folder of well-named notes and Obsidian's search will carry a short campaign comfortably. Dataview earns its place at about thirty NPCs, when you start needing "all living NPCs in this town" rather than "the note called Garruk".
Will Dataview slow my vault down?
Not at campaign scale. Queries run against an index, and a few hundred notes is nothing. Thousands of notes with a dozen queries on one page can take a moment on first open — rare in a campaign vault.
Does this work on mobile?
Yes. Dataview renders on Obsidian mobile, so the NPC table works on a phone or tablet at the table. Editing frontmatter on a phone is unpleasant; reading the dashboard is fine.
How do I track relationships between NPCs?
Links, not fields. Write [[Garruk Stonefist]] owes [[Mara Vell]] a favour in the body of a note and both notes show the connection in their backlinks. If you want it queryable, add a relations list field — but in practice the backlink panel plus a sentence of context beats a relationship database you have to maintain.
What about player characters — same system?
Same folder, type: pc. Then your NPC queries stay clean because they all filter on type = "npc", and a second short table gives you the party at a glance.