How to Automatically Send a Google Form Response as a PDF Attachment via Gmail

The Limitation of Google Forms

Google Forms is an exceptional tool for collecting data, but it has a significant gap in its automated workflow: it cannot natively format a submission into a professional document and email it to someone.

When someone submits a Form, the data simply drops into a row in a Google Sheet. If you are using Google Forms for something formal—like an IT equipment request, an HR incident report, or an invoice generation system—you don’t want to manually copy that spreadsheet row into a Word document every time. You want the system to automatically generate a clean, formatted PDF of their specific answers and email it directly to the relevant department (or the submitter themselves).

To achieve this, you need to bridge Google Forms, Google Docs, and Gmail using a script.

Step 1: The Components Required

You will need three specific files in your Google Drive to build this automation:

  1. The Google Form: Where the user inputs data (e.g., “Name”, “Request Type”).
  2. The Google Sheet: The spreadsheet where the Form sends its raw data.
  3. The Google Doc Template: A formatted document that acts as the blueprint for your PDF.

Step 2: Creating the Template

Create a new Google Doc. This will be the layout for your final PDF. Add your company logo, standard text, and formal formatting.

Wherever you want the user’s specific Form answers to appear, you use placeholder tags wrapped in double-curly braces.

For example, you might type:
Employee Name: {{Name}}
Equipment Requested: {{Request Type}}

(Ensure these placeholder tags exactly match the column headers in your Google Sheet).

Step 3: Accessing Google Apps Script

The automation engine that connects these apps is Google Apps Script (a JavaScript-based platform built into Google Workspace).

  1. Open the Google Sheet attached to your Form.
  2. Click on Extensions in the top menu.
  3. Select Apps Script.

This opens a blank coding environment. You will need to write (or paste) a script here.

Step 4: The Logic of the Automation Script

A full script is too long to print here, but conceptually, your JavaScript needs to perform the following actions in order:

  1. Trigger: The script must be set to run automatically onFormSubmit. This is an event listener.
  2. Capture Data: When triggered, the script reads the data from the newly added row in the spreadsheet.
  3. Duplicate Template: The script connects to the Google Doc Template you created in Step 2 and makes a temporary copy of it.
  4. Replace Text: The script searches the temporary document for your tags (e.g., {{Name}}) and replaces them with the actual data from the spreadsheet row (e.g., “John Smith”).
  5. Convert to PDF: The script commands Google Drive to render the modified temporary document as a PDF blob (binary data).
  6. Send via Gmail: The script calls the MailApp.sendEmail() function, passing the destination email address, a subject line, and attaching the newly created PDF blob.
  7. Cleanup: The script deletes the temporary Google Doc to keep your Drive organized.

Step 5: Setting the Trigger

Once your code is written and saved in the Apps Script editor, you must activate the trigger.

  1. In the Apps Script editor, click the Triggers icon on the left sidebar (it looks like a clock).
  2. Click Add Trigger in the bottom right.
  3. Select your main function (usually named something like createPdfAndEmail).
  4. Under “Select event source”, choose From spreadsheet.
  5. Under “Select event type”, choose On form submit.
  6. Click Save. You will be prompted to grant the script permission to access your Drive and Gmail.

Once authorized, the system is fully automated. The next time someone clicks “Submit” on your Google Form, they will seamlessly trigger a chain reaction that generates a pristine PDF report and delivers it via Gmail in seconds.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.