Ask
27

How do I get a template applied automatically when a note is created, rather than remembering to insert it?

I use templates for meeting notes and daily notes, and I insert them by hand every time. Half the time I forget, write the note anyway, and end up with a note missing the metadata all my queries depend on.

I would like the template applied at the moment the file is created, based on which folder it lands in.

I can see there is a setting about triggering on new file creation, and some mention of folder templates, but turning it on had effects I did not expect and I turned it back off again.

What is the correct setup, and what are the side effects I ran into?

4 answers Share
Report

Answering anonymously — a moderator will review it first.

  • @template_tolga · yesterday

    The setup is two settings that have to be on together, and the surprises you hit are real and worth understanding rather than working around blindly.

    The setup:

    1. Enable the trigger on new file creation. This is the master switch. Without it, folder templates do nothing at all.
    2. Define folder templates, mapping a folder to a template file. Now a note created in your meetings folder gets the meeting template, one created in your daily folder gets the daily template.
    3. Set a default template for anything outside a mapped folder, or leave it empty so those files stay blank. I would leave it empty — a template applied to a quick scratch note is more annoying than no template.

    Now the side effects, which are what sent you back.

    It fires for files created by anything, not just by you. That includes:

    • files arriving through sync from another device
    • files created by other plugins
    • files created by an importer

    The sync one is the significant hazard. A note created on your phone syncs to your desktop, the desktop sees a new file appear, and the template runs against it — inserting the template into a note that already has content, on the other machine. This is the reported cause of duplicated headers and mangled notes and it is why the setting has a reputation.

    In practice modern versions handle the common cases, but the failure mode is bad enough that it is worth verifying deliberately: create a note on one device, watch what arrives on the other, before you trust it with a month of meetings.

    Dynamic content runs at creation time, which is the point but has a consequence. If your template inserts today's date, it inserts the date the file was created. Fine for a daily note. Not fine if you create tomorrow's note tonight, which the daily-note feature does — there is a separate setting to make the date-aware behaviour line up with the intended date rather than the wall clock, and getting it wrong produces notes titled one day and dated another.

    It can interact badly with other plugins that create files. Anything that generates notes in bulk now generates them with a template applied. Usually harmless, occasionally not.

    The safer variant, if this makes you nervous: skip automatic creation and bind a hotkey to "create note from template" instead. You lose the guarantee and you keep total control over when it fires. Given that your actual problem is forgetting, that trade may not suit you — but it is what I would suggest for a vault that syncs across several devices.

    A middle path that works well: enable it, but keep templates minimal — front matter and headings only, nothing dynamic beyond the date. A template that only adds structure is nearly harmless if it fires unexpectedly, and it still solves your missing-metadata problem, which is the actual goal.

    30
    Share
    Reply

    Answering anonymously — a moderator will review it first.

    Report
  • @query_first_quinn · 14h ago

    One thing to get right early: put the front matter in the template, and put the fields your queries depend on in it even when they will be empty.

    An empty field is indexed and queryable. A missing field is not, and a query filtering on it silently drops the note instead of showing it with a blank column. That difference is what produces "my dashboard is missing notes I know exist", which is a miserable thing to debug months later.

    So the template should carry every field, with sensible empty defaults. Filling one in later is easy; noticing that a field was never there is not.

    22
    Share
    Reply

    Answering anonymously — a moderator will review it first.

    Report
  • @markdown_mateo · 21h ago

    Test the sync interaction specifically, as suggested above, and test it in the direction that scares you: create a note on the device that does not have the plugin enabled, and see what the device that does makes of it.

    That is the asymmetric case and it is where the reported damage comes from. Five minutes with a throwaway note, and then you know rather than hope.

    15
    Share
    Reply

    Answering anonymously — a moderator will review it first.

    Report
  • @vault_hygiene_val · 9h ago

    Back the vault up before you turn this on, and mean it — the failure mode is a plugin writing into notes automatically across your whole vault, which is exactly the category of change that is hard to undo by hand.

    If your vault is a git repository, commit first. If it is not, this is a good moment to make it one: a notes vault is plain text files, which is the ideal case for version control, and it converts "a plugin mangled forty notes" from a disaster into a one-line revert.

    I enable anything that writes automatically only in a vault that has a clean commit behind it. Costs nothing, and I have used the revert twice.

    26
    Share
    Reply

    Answering anonymously — a moderator will review it first.

    Report