Generate a Permit Certificate Automatically
Templates produce PDFs through the Generate PDF automation action. This guide binds a Building Permit Certificate template to an issuance automation: when staff set a permit's status to Issued, GovAssist renders the certificate, saves it in a file field on the permit, and emails it to the applicant.
Prerequisites
- A published, Active PDF template for the permit entity (see Publish and Activate a Template).
- On the permit entity: a file field to hold the certificate (for example, Permit Certificate), a status field with an Issued option, and an applicant email field, directly on the permit or on an associated contact.
- Permission to create and publish automations (see Automation Builder).
What the Generate PDF action needs
| Setting | What to enter |
|---|---|
| Name | A label for the step, at least 3 characters |
| Entity selection | The entity the template was built for |
| PDF Template Selection | The template. The list shows templates built for the selected entity |
| Record Id | The record to render, inserted from the trigger with the + button |
| PDF Name | File name for the generated PDF, 3 to 100 characters |
| Output Field | Optional. A file field on the record where the PDF is saved. Only file fields are listed |
| Override Existing File | On: replace whatever is in the output field. Off: add the new PDF alongside earlier files |
The step's result is available to later steps as Generated PDF, so a Send Email step can attach it.
Steps
Create the automation
Open Automations for your app and click Add Automation. Give it a Name such as "Issue Building Permit Certificate" and a Description.
Set the trigger
Click the trigger node and choose When record is updated. Set Entity selection to Building Permit and, in Watching Fields, choose the status field so the automation runs when the status changes.
Check that the permit is now Issued
Add an IF/ELSE Conditions step that continues only when the status equals Issued. Without it, every status change would produce a certificate.
Add the Generate PDF action
On the true branch, add an action node and choose Generate PDF. Fill in the settings from the table above: select the Building Permit entity and the Building Permit Certificate template, insert the trigger's record ID into Record Id, enter a PDF Name, choose the Permit Certificate file field as Output Field, and turn on Override Existing File so a reissued permit carries one current certificate.
Email the certificate
Add a Send Email action after Generate PDF. Use + next to To to insert the applicant's email from the record, then write the Subject and Message. In Attachments, switch to Dynamic file upload and choose the Generated PDF from the Generate PDF step.
Publish and test
Publish the automation. On a test permit with every certificate field filled in, set the status to Issued. Open the permit's Permit Certificate field to view the PDF, and check the applicant inbox for the email.
Edits to the template after go-live
The automation always renders the template's last published version. Saved but unpublished edits do not reach certificates until you click Publish.
Example
The complete Building Permit Certificate setup:
| Piece | Setting | Value |
|---|---|---|
| Template | Template Name | Building Permit Certificate |
| Template | Entity, Template Type | Building Permit, Permit Certificate |
| Template | Force Single Page | Checked |
| Template | State | Published, Active |
| Trigger | When record is updated, Watching Fields | Status |
| Condition | IF/ELSE Conditions | Status equals Issued |
| Generate PDF | PDF Template Selection | Building Permit Certificate |
| Generate PDF | PDF Name | Building Permit Certificate |
| Generate PDF | Output Field, Override Existing File | Permit Certificate, on |
| Send Email | To, Subject | Applicant Email, Your building permit has been issued |
| Send Email | Attachments | Dynamic file upload: Generated PDF |
Common mistakes
- Template not Active. The Generate PDF step fails for an inactive template. Publish it and switch it to Active.
- Template built for a different entity. PDF Template Selection only lists templates for the selected entity. If yours is missing, check the template's entity.
- No condition on the status. A trigger that watches the status without a condition generates a certificate on every status change.
- Output field is not a file field. Only file fields can hold the PDF. Add one to the entity first.
- Override left off for reissues. Each run adds another file to the field. Turn on Override Existing File when only the current certificate should remain.
- Testing with an empty record. Blank fields print blank. Test with a record that has every merge field filled.