Parse Draft and Update Content

Need help figuring out what to remove from Action Share Parsed Template so that instead of emailing the action can update the draft with filled-in content.

I know there is Insert Text action that can be built from scratch but for long text drafts it may be easier to parse a draft rather than create/modify Insert Text with Prompt action.

Edit: Through trial and error I figured a few things out but not sure that I am doing the right thing.

  1. To update the existing draft, add this at the end of the Parse Script Action
// Update content
draft.content = draft.processTemplate("[[parsed_draft]]");
draft.update("[[parsed_draft]]");
  1. To create a new Draft from an existing draft, add this at the end of the Parse Script Action:

// Create a new draft from existing

var d = Draft.create();
d.content = draft.processTemplate(“[[parsed_draft]]”);
d.update();
editor.load(d);
draft = d;

Questions

Q1. Where does the “parsed_draft” come from. I can’t find it in the original script anywhere.

Q2. How can I connect this script to an existing draft template so that it turns into a single action:

  1. Use New Draft with Template to choose a template.
  2. Run Parse Template to parse the draft for variable.

All in one action.