Send to Obsidian — with tags and YAML metadata

I think your tags should be formatted as a YAML list as covered in the Obsidian docs for the tags property in the note front matter.

Setting up an action like this:

Then using a draft like this:

# Call Log Example

Spoke about X

Spoke about Y

Spoke about Z

Gives me a note in Obsidian like this:

If you (or anyone else), did want to transfer Drafts tags to Obsidian tags, adding a script step like this ahead of the file creation:

let strTags = "";
if(draft.tags.length > 0) strTags = "\n" + draft.tags.map(x => "  - " + x).join("\n");
draft.setTemplateTag("YAMLTags", strTags);

 
Means you can then use this line in your content template to put the Drafts tags in as Obsidian tags.

tags:[[YAMLTags]]

 
Hope that helps.

1 Like