How do insert a template into front matter?

What I’m trying to do

Insert a template into frontmatter.

Things I have tried

I tried inserting a template like normal, by pressing Cmd-Opt-t, and it does nothing. I tried use Templater, and it does nothing.

It only works when the cursor is outside of the front matter.

Switch to Source Mode first, then you can insert templates into front matter normally.

Yes, source mode is the key. The Properties UI is not a normal editor area, so template insertion commands usually do nothing there. I would insert it in Source mode and keep the template output valid YAML, for example no unquoted colon characters inside a value. If you are using Templater, test with one simple field first, then expand it, because a small YAML syntax error can make the properties panel look like the insertion failed.

If your template is specific to properties:

When you insert a template into the active note, all the properties from the template will be added to the note. Obsidian will also merge any properties that exist in your note with properties in the template. (Templates § Template properties - Obsidian Help)

As CawlinTeffid and others said, Source mode is the key — but the real trap is the template output being invalid YAML. An unquoted colon inside a value, a tab in indentation, or an unescaped [[wikilink]] in a property will silently break the Properties panel and make it look like the insert failed.

A quick safety check: after inserting a Templater template, paste the note into a browser-only front matter checker that only scans the --- block and shows the exact broken line. I built one that runs 100% locally (no upload) so Dataview/Templater code in the body never causes false positives: YAML Frontmatter Validator & Fixer — Validate and Auto-correct Obsidian / Hugo / Jekyll (Free, Private)

(Disclosure: I made it — sharing because it directly helps confirm whether the inserted template produced valid YAML.)