Using templates

Hello, I am testing “New drafts with template” for my workflow.
Is it possible to use a description in the template without see it in the new draft.
I think this should be possible but i need the right solution :wink:
Thank you.

Blue_dancer

It is certainly very possible, in a variety of ways. Probably the most straight-forward within this particular action would be to use the first line of the template draft as the description, then remove that line when processing it to create the new draft.

In the New Draft from Template action, look for the below line, which is where the content of the new draft gets assigned:

d.content = d.processTemplate(template.content);

And replace it with this:

// remove first line from template draft content
let templateString = template.content.split("\n").slice(1).join("\n")
d.content = d.processTemplate(templateString);

Sorry, something went wrong. I think its my foult…but I don´t know were…

thank you for your help.

blue_dancer

My bad, had a typo in the original reply. I fixed it above, if you try again.

I think there should be a “;” behind „…\n“);

Thank you vor your help.
Blue_dancer

That should not be needed. Semi-colons, though generally recommended, are optional in JavaScript.

1 Like