Tailflow
Skip to article
Browse documentation

Google Docs · Action

Create document from template

Makes a copy of a template document and replaces each placeholder in it, such as {{amount}}, with a value from the event. The layout of the template is kept.

When to use it

A formatted incident or transfer report per event, with the same headings and table every time.

At a glance

IntegrationGoogle Docs
Credits1
ConnectionGoogle Docs, by signing in

Settings

templateRequiredAccepts event fields
Template. The template's id or link. It must be a document made by Google Docs or Google Drive steps, which you can then edit by hand.
nameRequiredAccepts event fields
Name.
valuesRequiredAccepts event fields
Placeholders. One row per placeholder. Type its name without braces, such as amount for {{amount}}. The value can use values from the event. One row per name and value.

What it hands on

Actions run in order, and each one can read what the actions above it produced. This one writes the fields below; a later action reaches them as {{ actions.docs_create_from_template_1.id }} — the action’s key, then which one it is if you use more than one of the same kind.

id
The document's id. It is what Append text, Find and replace text and Get document content take.
name
The document's name.
link
The address that opens the document in a browser.
replaced
How many placeholders were found and filled in, counting each one every time it appears.

Good to know

  • The template must be a document made by a Google Docs or Google Drive step. Make an empty one with Create document from text in a flow you run once, then open it in Google Docs and write the template by hand.
  • Type each placeholder's name without braces: amount fills in {{amount}} and {{ amount }}. A name typed with other marks, such as [amount], is looked for exactly as typed.
  • Placeholder names mind capitals.
  • A value that renders empty removes the placeholder, so no braces are left in the document.
  • The copy is made first and filled in second. If filling in fails, the copy is left in your Drive with its placeholders, and the step's failure gives its id.
  • A template id typed into the step that cannot be found stops the flow.