Obsidian - Create a Handlebar Template from CSV (JSON/CV Importer)
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.
Install the JSON CSV Importer plugin, then use it to connect a CSV dataset to a Handlebars template and generate notes in bulk.
Briefing
Bulk-importing TTRPG data into an Obsidian vault becomes practical once a CSV source is paired with a Handlebars template that maps CSV columns into Obsidian note front matter and body fields. The core payoff: a user can take a dataset such as Pathfinder’s System Reference Document (SRD) magic items and generate hundreds of consistently formatted notes in minutes—fast enough to go from “zero notes” to “a large library” while waiting for something as mundane as a coffee.
The workflow starts by installing the “JSON CSV Importer” community plugin in Obsidian, then sourcing data from the web. A common path is searching for an SRD dataset in CSV form (for example, “Pathfinder SRD csv”), often hosted on GitHub. After downloading the relevant CSV folder (such as “raw/spells” or “raw/magic items”), the user opens the CSV in Excel to confirm the table structure and, when needed, trims the dataset for testing. Column names matter: the importer and Handlebars templates won’t handle spaces or special characters in column headers, so the CSV must be cleaned so headers are compatible.
Next comes template creation. The user creates a dedicated folder for Handlebars templates inside the vault, then writes a template note that mirrors the desired output format for each imported item. The template includes front matter variables (for example, name, aura, cl, slot, weight, group, source, base item, and description), while the visible note body uses Handlebars expressions like {{name}} and {{aura}} to place CSV values into the correct locations. To avoid duplicating logic and to keep the template flexible, the template can also use Obsidian’s DataView plugin with inline queries that pull values from front matter into the body—e.g., referencing fields as this.file.name or this.file.<field> to populate repeated sections.
Once the template is ready, the JSON CSV Importer is used to connect the CSV file to the template. The importer settings include selecting the CSV data source, choosing the template file, and specifying which CSV column becomes the note name (commonly the “name” column). Options like “override existing notes” are important during iteration: the creator runs the import multiple times, fixing template mistakes such as incorrect DataView syntax or mismatched field names (for instance, using “cl” vs “CL” or accidentally leaving a Handlebars field pointing to the wrong column). After a successful import, the resulting notes land in the chosen destination folders (e.g., mechanics and spells), with front matter populated and links working cleanly.
The process isn’t limited to magic items. The same approach can generate monster stat blocks and encounter cards by pairing CSV columns with the TTRPG stat block application’s expected fields, including images named after the monster (e.g., {{name}}.png). When imported notes contain messy characters or formatting artifacts, the creator recommends post-processing with tools like search-and-replace (including regex) in an editor such as Sublime Text. Overall, the method turns scattered web tables into a structured, linkable Obsidian knowledge base with minimal manual typing.
Cornell Notes
A reliable bulk-import method for Obsidian uses the JSON CSV Importer plus a Handlebars template that maps CSV columns into note front matter and body fields. After downloading an SRD dataset (often from GitHub) and cleaning CSV headers to remove spaces/special characters, the template is built to match the desired note layout—using Handlebars variables like {{name}} and {{aura}}. DataView inline queries can further pull front matter values into repeated sections without duplicating logic. Imports are then run from the plugin by selecting the CSV file, the template, and the column used as the note name; iteration is normal when syntax or field mappings are off. The same pattern can generate monsters, spells, and encounter cards, including image filenames derived from {{name}}.
Why do CSV column names need cleaning before building a Handlebars template in Obsidian?
How does the template ensure each imported note gets a unique name and correct metadata?
What role does DataView play in the template beyond basic Handlebars substitution?
What kinds of mistakes commonly require re-importing and editing the template?
How can the same import approach generate monsters with images and encounter triggers?
What’s a practical way to clean up messy imported text after the fact?
Review Questions
- What specific constraints on CSV headers affect whether Handlebars variables can map correctly during import?
- How do note naming and front matter variables work together to ensure each imported row becomes a correctly linked Obsidian note?
- Which two categories of errors most often require re-running the import after template edits (field mapping vs DataView syntax)?
Key Points
- 1
Install the JSON CSV Importer plugin, then use it to connect a CSV dataset to a Handlebars template and generate notes in bulk.
- 2
Clean CSV column headers to remove spaces and special characters; template field mapping depends on header names matching exactly.
- 3
Design a template note that matches the target output layout, using Handlebars variables (e.g., {{name}}, {{aura}}) for repeated fields.
- 4
Use DataView inline queries when you want body content to pull from front matter values without duplicating logic, but expect syntax debugging.
- 5
Choose a single CSV column (typically “name”) as the note name so each row becomes a unique, linkable note.
- 6
Iterate: re-import with “override existing notes” after fixing casing mismatches, wrong column mappings, or DataView query errors.
- 7
Post-process imported text with search-and-replace (optionally regex) to fix formatting artifacts and odd characters across many notes quickly.