Document Templates

Generate professional PDF documents from form submissions using customizable templates with field placeholders

What This Feature Does

Document Templates allow you to create professional PDF documents from form submissions. Instead of manually copying data into Word or Excel, you define a template once and generate polished documents automatically. Templates can include your branding, formatted layouts, and all the data from form submissions.

Understanding Templates

How Templates Work

  1. Create a template with placeholders for form fields
  2. User submits a form with their data
  3. Generate document that replaces placeholders with actual values
  4. Download or share the completed PDF

Template Components

  • Static Content: Text, images, and formatting that appear on every document
  • Field Placeholders: Variables replaced with submission data
  • Conditional Sections: Content that appears based on field values
  • Repeating Sections: Content that repeats for table data

Creating a Template

Setting Up Your First Template

  1. Navigate to "Forms" in the left sidebar
  2. Select the form you want to create a template for
  3. Click the "Templates" tab
  4. Click "Create Template"
  5. The template builder opens

Template Builder Interface

Left Panel - Field Placeholders

  • Lists all fields from your form
  • Click to insert placeholder at cursor
  • Shows placeholder syntax

Center Canvas - Template Editor

  • Rich text editing area
  • WYSIWYG formatting
  • Drag to position elements

Right Panel - Settings

  • Document settings (size, margins)
  • Header/footer configuration
  • Page numbering options

Adding Content to Templates

Static Text

Type directly in the template editor:

  • Format text using the toolbar (bold, italic, etc.)
  • Create headings and paragraphs
  • Add bullet points and numbered lists

Field Placeholders

Insert form data using placeholders:

  1. Place cursor where you want the data
  2. Click a field in the left panel, or
  3. Type the placeholder manually: {{field_name}}

Example:

Site Inspection Report

Location: {{site_location}}
Date: {{inspection_date}}
Inspector: {{inspector_name}}

Available Placeholder Types

Form Fields:

  • {{field_name}} - Value of any form field

Submission Metadata:

  • {{_submission_id}} - Unique submission ID
  • {{_submitted_at}} - Submission date/time
  • {{_submitted_by}} - Name of person who submitted
  • {{_form_name}} - Name of the form

Account Information:

  • {{_account_name}} - Team/company name
  • {{_account_logo}} - Company logo image

Formatting Placeholders

Date Formatting

Format dates with modifiers:

  • {{date_field}} - Default format
  • {{date_field | date:"MM/DD/YYYY"}} - Custom format
  • {{date_field | date:"MMMM D, YYYY"}} - Long format (January 15, 2025)

Number Formatting

Format numbers with modifiers:

  • {{amount}} - Raw number
  • {{amount | currency}} - Currency format ($1,234.56)
  • {{amount | number:2}} - Two decimal places

Text Formatting

Transform text:

  • {{name | uppercase}} - UPPERCASE
  • {{name | lowercase}} - lowercase
  • {{name | capitalize}} - Capitalize First Letter

Adding Images

Static Images

Add fixed images to your template:

  1. Click "Insert Image" in the toolbar
  2. Upload an image or provide URL
  3. Position and resize as needed

Common uses:

  • Company logo
  • Certification marks
  • Standard diagrams

Dynamic Images from Form Fields

Include images uploaded in form submissions:

  1. Ensure your form has a FileUpload field for images
  2. In the template, insert: {{image_field}}
  3. The uploaded image appears in the document

Signature fields:

  • {{signature_field}} - Includes the captured signature

Image Sizing

Control image dimensions:

  • {{image_field | width:200}} - Set width in pixels
  • {{image_field | height:150}} - Set height in pixels
  • {{image_field | maxWidth:300}} - Maximum width

Table Data

For forms with Table fields, generate rows dynamically.

Repeating Rows

Create a table that repeats for each row in a Table field:

Materials Used:
| Material | Quantity | Unit |
|----------|----------|------|
{{#materials_table}}
| {{material}} | {{quantity}} | {{unit}} |
{{/materials_table}}

Table Syntax

  • {{#table_field}} - Start repeating section
  • {{/table_field}} - End repeating section
  • Inside: use column names as placeholders

Table Calculations

Include calculations for table data:

  • {{materials_table.count}} - Number of rows
  • {{materials_table.sum:quantity}} - Sum of quantity column
  • {{materials_table.avg:price}} - Average of price column

Conditional Content

Show or hide sections based on field values.

Basic Conditionals

{{#if status == "Failed"}}
⚠️ INSPECTION FAILED - Immediate action required
{{/if}}

If-Else Conditionals

{{#if risk_level == "High"}}
This is a HIGH RISK area. Take extra precautions.
{{#else}}
Standard safety procedures apply.
{{/if}}

Multiple Conditions

{{#if status == "Failed" && severity == "Critical"}}
CRITICAL FAILURE - Escalate immediately
{{/if}}

Checking for Empty Values

{{#if comments}}
Additional Comments: {{comments}}
{{/if}}

Only shows the section if comments field has a value.


Headers and Footers

Adding a Header

  1. Click "Header" in the template settings
  2. Add content:
    • Company logo
    • Document title
    • Page numbers
  3. Header appears on all pages
  1. Click "Footer" in the template settings
  2. Add content:
    • Page numbers: Page {{_page}} of {{_pages}}
    • Date generated
    • Confidentiality notice
  3. Footer appears on all pages

Different First Page Header

  1. Enable "Different First Page"
  2. Configure first page header separately
  3. First page can have a detailed header
  4. Subsequent pages have a simplified header

Page Settings

Document Size

Choose page size:

  • Letter (8.5" x 11")
  • A4 (210mm x 297mm)
  • Legal (8.5" x 14")
  • Custom dimensions

Margins

Set page margins:

  • Top, Bottom, Left, Right margins
  • Consistent margins for professional appearance

Orientation

Choose orientation:

  • Portrait (vertical)
  • Landscape (horizontal)

Template Examples

Safety Inspection Report

[Company Logo]

SAFETY INSPECTION REPORT

Date: {{inspection_date | date:"MMMM D, YYYY"}}
Location: {{site_location}}
Inspector: {{inspector_name}}

---

INSPECTION SUMMARY
Overall Result: {{overall_status}}
Risk Level: {{risk_level}}

{{#if overall_status == "Failed"}}
⚠️ ACTION REQUIRED: This inspection has failed.
Please address all issues before work continues.
{{/if}}

---

INSPECTION ITEMS

{{#inspection_items}}
☐ {{item_description}}
   Status: {{item_status}}
   {{#if item_notes}}Notes: {{item_notes}}{{/if}}
{{/inspection_items}}

---

PHOTOS

{{#if site_photos}}
{{site_photos}}
{{/if}}

---

SIGNATURES

Inspector: {{inspector_signature}}
Date: {{_submitted_at | date:"MM/DD/YYYY"}}

Supervisor: {{supervisor_signature}}
Date: {{supervisor_date | date:"MM/DD/YYYY"}}

Daily Site Diary

DAILY SITE DIARY

Project: {{project}}
Date: {{diary_date | date:"dddd, MMMM D, YYYY"}}
Weather: {{weather_conditions}}

---

PERSONNEL ON SITE

{{#workers_table}}
• {{worker_name}} - {{trade}} ({{hours}} hours)
{{/workers_table}}

Total Workers: {{workers_table.count}}

---

WORK COMPLETED TODAY

{{work_description}}

---

MATERIALS DELIVERED

{{#materials}}
• {{description}} - Qty: {{quantity}}
{{/materials}}

---

ISSUES/DELAYS

{{#if issues}}
{{issues}}
{{else}}
No issues reported.
{{/if}}

---

Submitted by: {{_submitted_by}}
Date/Time: {{_submitted_at}}

Generating Documents

From a Single Submission

  1. Navigate to Submissions
  2. Open the submission you want to generate a document for
  3. Click "Generate Document"
  4. Select the template to use
  5. Click "Generate"
  6. PDF downloads or opens in new tab

Bulk Generation

Generate documents for multiple submissions:

  1. In the submissions list, select multiple rows
  2. Click "Bulk Actions"
  3. Select "Generate Documents"
  4. Choose template
  5. Click "Generate"
  6. Download ZIP file with all PDFs

Automated Generation via Workflow

Generate documents automatically on submission:

  1. Set up a Workflow
  2. Add "Generate Document" action
  3. Select template
  4. Configure delivery:
    • Attach to submission
    • Email as attachment
    • Save to storage

Managing Templates

Editing Templates

  1. Navigate to form's "Templates" tab
  2. Click on template to edit
  3. Make changes
  4. Save template

Duplicating Templates

  1. Click actions menu on template
  2. Select "Duplicate"
  3. Modify the copy as needed
  4. Save with a new name

Deleting Templates

  1. Click actions menu on template
  2. Select "Delete"
  3. Confirm deletion

Note: Deleting a template doesn't affect already-generated documents.

Template Versions

Templates maintain version history:

  1. Open template
  2. Click "Version History"
  3. View previous versions
  4. Restore if needed

Troubleshooting

If placeholders aren't replacing

  • Verify placeholder syntax: {{field_name}}
  • Check field name matches exactly (case-sensitive)
  • Ensure the field has a value in the submission

If images aren't appearing

  • Check image field has an uploaded file
  • Verify file is an image format
  • Check image sizing isn't too small

If tables aren't generating rows

  • Verify table field has data
  • Check opening and closing tags match
  • Ensure column names are correct

If conditional content isn't working

  • Verify field values match condition exactly
  • Check operator syntax (==, !=, &&, ||)
  • Test with simpler conditions first

If PDF layout is broken

  • Check page margins
  • Reduce image sizes
  • Simplify complex formatting
  • Test with less content

Best Practices

  • Design for data: Plan templates around your form fields
  • Test thoroughly: Generate test documents with various data
  • Use consistent branding: Include logo and company colors
  • Keep it readable: Don't overcrowd with too much data
  • Consider printing: Test how documents look when printed
  • Version control: Keep track of template changes
  • Document your templates: Note what each template is for

What's Next

After creating templates, you may want to: