How to automate invoices with Google Forms, Sheets and Docs

You will build a small workflow that turns Google Form responses into filled invoice documents. It suits anyone who sends repeated invoices and wants to stop copying and pasting. You need a Google account and basic comfort with opening Apps Script.

YouTube video: How to Automate Invoice Creation with Google Sheets, Docs and Forms

Caption availability is unknown. Check the CC control in the YouTube player.

Video length
11 min 27 s
Time to do it
30 minutes
Difficulty
Medium
Steps
8

What you need

Steps

  1. Create a Google Form with short answer fields for client name, email, invoice number, item description, quantity, unit price and due date. Turn on response validation for the email field if you want cleaner data.

  2. Open the form's Responses tab and click the Sheets icon to create a linked spreadsheet that stores every submission.

  3. Make a Google Docs invoice template with a fixed layout and placeholder text such as {{Client Name}} and {{Invoice Number}} where the answers should go.

  4. In the linked Sheet, go to Extensions > Apps Script. Write a script that opens the template, copies it, and uses body.replaceText to swap each placeholder for the matching form answer.

  5. Add lines to the script that save the new document as a PDF in a chosen Drive folder and email it to the client address from the form.

  6. Save the script, open Triggers in the left sidebar, and add a trigger for the form submit function. Set the event source to Form submit and save.

  7. Submit a test response with your own email. Check the Drive folder for the PDF and open it to confirm every placeholder was replaced correctly.

  8. If the test fails, compare each placeholder in the Doc with the script text. Fix any difference in spelling, spaces or capitals, then run the test again.

Tips and common mistakes

Use double curly braces for placeholders and keep the exact same wording in the Doc and the script.

Authorize the script the first time you run it, since Google will ask for permission.

Keep the template and the target PDF folder in your own Drive so the script can find them.

Questions

Do I need to write code?

You need a short Apps Script. You can copy a working example and change the placeholder names to match your template.

Can I use this for other documents?

Yes. The same form, sheet and template pattern works for quotes, receipts and simple contracts.

Why did my placeholders not fill?

Check that each placeholder matches the script exactly and that the trigger is set to run on form submit.

The notes are drafted automatically from video details and general task knowledge. How the guide was prepared

Report a correction

More in Money & Office

See all