Automette docs

Save a document link in Google Sheets

This sets up a workflow that watches one tab of a spreadsheet. When a row is added, a document is made from the row's columns and its link is written into a column of that row.

Prerequisites

  • A Google account connected under Connectors.
  • A template whose fields match your column headers.
  • A column for the link, for example Document.

1. Create the workflow

On Workflows, click New workflow, then Start blank. Name it in Settings.

2. Choose the sheet

Open Run when and choose Google Sheets row under Also start it. Choose your Google account, paste the spreadsheet's link under Spreadsheet, and choose the Tab.

Leave Run when on A row is added, or choose A row is changed to run on edits. To run only when a box is ticked, set Only when this column changes to the column's header and To this value to TRUE.

3. Connect the spreadsheet

Google does not tell anyone about edits on its own, so a small script in the spreadsheet does. You add it once per spreadsheet. Under Connect the spreadsheet, click Show script and Copy script, then:

  1. In the spreadsheet, open Extensions → Apps Script.
  2. Delete any code there and paste the script.
  3. Click Save, choose setup in the function menu, and click Run.
  4. Come back and click Check again.

4. Make the document

Open Steps, click + on the line in the diagram, then Step, and choose Generate document. Pick the Template, and under Field values choose the row's columns for each field.

Click +, then Step, and choose Update Google Sheet. Choose the same account, spreadsheet and tab, set What to do to Change one row, and set Row number to the row from the trigger. Under Values to write, put the document's link in your link column, for example Document.

6. Write errors into the row

On the Generate document step in the diagram, click ⋯, then Add "If it fails". Click + on the new path, add a step, choose Update Google Sheet with Change one row, and write ERROR: and Why it failed into your link column. The row then shows the reason instead of a link, and the task completes.

7. Save a version

Click Save version, then add a row. Its link appears in the row within a minute.

Last updated on

On this page