Generate a PDF Document
The Generate PDF action fills a PDF template with a record's data, such as an issued permit, a license certificate, or a decision letter, and saves the file to the record. Later steps can attach the same PDF to an email.
Prerequisites
- Your app includes permitting. Generate PDF is offered only in those apps.
- A PDF template for the entity, built in PDF Templates. For a full walkthrough of a permit certificate, see Generate a Permit Certificate with an Automation.
- A file field on the entity to store the generated PDF (for example, Issued Permit Document). See Add a File Field.
Steps
Add a Generate PDF step
Click + where the PDF should be created and choose Generate PDF. Place it after any step that sets values the document shows, such as the issue date or permit number.
Choose the record
Set Entity selection to the record type and Record Id to the record to print, usually the trigger step's Record ID.
Choose the template
In PDF Template Selection, pick the template.
Name the file
Enter a PDF Name. Click + to include values, for example the permit number, so each file has a unique, readable name.
Choose where to save it
In Output Field, pick the file field that will hold the PDF. Turn on Override Existing File to replace any file already in that field; leave it off to add the new file alongside existing ones.
Save
Enter a Name for the step and click Save Changes.
Settings
| Setting | Required | Description |
|---|---|---|
| Entity selection | Yes | The record type the template is built for |
| Name | Yes | Label for this step |
| Record Id | Yes | The record whose data fills the template |
| PDF Template Selection | Yes | The template to use |
| PDF Name | Yes | File name of the generated PDF |
| Output Field | No | File field on the record where the PDF is saved |
| Override Existing File | No | On: replace the file in the output field. Off: append. |
After this step, the generated file is available to later steps as Generated PDF. In a Send Email step, choose Dynamic file upload in Attachments and pick it.
Example
Issue a Food Truck Permit certificate once the permit is approved.
| Setting | Value |
|---|---|
| Entity selection | Food Truck Permit |
| Name | Generate permit certificate |
| Record Id | Trigger step's Record ID |
| PDF Template Selection | Food Truck Permit Certificate |
| PDF Name | Food Truck Permit + Permit Number |
| Output Field | Permit Certificate |
| Override Existing File | On |
Common mistakes
- Generating the PDF before the step that sets the issue date or permit number, so the document prints blank values.
- Leaving Override Existing File off on an automation that can run more than once, which piles up copies on the record.
- Choosing a template built for a different entity than the one in Entity selection.