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?
@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:
Now the side effects, which are what sent you back.
It fires for files created by anything, not just by you. That includes:
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.
Reply
Report