This project is an automated document generation tool built on Google Workspace.
It enables users to generate customized PDF documents by simply submitting a Google Form — eliminating repetitive manual work such as duplicating templates and manually filling in data.
The tool was originally created to automate medical prescription exports, but it is designed to be reusable for any form-based document workflow, including reports, invoices, etc.
-
The user fills in a Google Form
(e.g. name, date of birth, description, selected options). -
Upon submission:
- Responses are stored in Google Sheets
- A Google Docs template is duplicated
-
The template is automatically populated with the submitted data.
-
A PDF version of the document is generated and saved to a designated Google Drive folder.
-
The generated PDF is automatically emailed to a specified email address, along with a customizable email content body.
This workflow enables efficient batch document generation without manually copying templates.
- Google Forms: data input
- Google Sheets: response storage
- Google Docs: document templating
- Google Drive: destination folder (to store newly created PDF documents)
- Google Apps Script: automation logic & APIs
- HTML & JavaScript: scripting
To customize this project for your own use, you will need:
- Basic programming skills in HTML and JavaScript
- A Google account with access to:
- Google Forms
- Google Docs
- Google Drive
Tip
Each document and folder in Google Workspace has a unique ID.
Make sure to replace all IDs in the script with your own.
Setup typically involves:
- Creating your own Google Form
- Clicking “View in Sheets” to generate a response spreadsheet
- From the spreadsheet, navigating to
Extensions→Apps Script - Adding both
Code.gsandEmailTemplate.htmlunder the Files section - Designing your own Google Docs template
- Creating your own Google Drive destination folder
- Editing
Code.gsto map form responses to template placeholders - Editing
EmailTemplate.htmlto customize the email body content - Configuring Apps Script triggers on form submission
If you have any suggestions to improve this project or run into any issues while setting it up, feel free to reach out!