SnapApp Document Generation
on 01-27-2026 12:00 AM by SnapApp by BlueVector AI
2183
Introduction
SnapApp Document Generation allows you to automatically create documents (DOCX or PDF) by combining:
- A document template, and
- Data stored in SnapApp records
This is useful for generating contracts, reports, invoices, letters, or any document that needs dynamic data.
The process involves:
- Creating a document template
- Uploading the template to SnapApp
- Configuring a workflow and action
- Triggering document generation using a button
This guide explains each step in detail so even beginners can follow along.
Table of Contents
- Step 1: Create Your Template File
- How to Create the Template
- Step 2: Document Template Rules (Field Substitution)
- 1. Referencing Fields from the Current Object
- 2. Using Expressions
- 3. Referencing Parent Records
- 4. Referencing Child Records
- 5. Referencing Other Objects Using SELECT
- 6. Using SELECT with Filters
- 7. Using Fields Inside SELECT Queries
- 8. Adding Images
- 9. Conditional Logic (IF / ELSE)
- 10. Tables with Child Records
- 11. Tables with External Records
- Step 3: Create the Template Record in SnapApp
- Step 4: Create a Generated File Field (Optional)
- Step 5: Add the Generated Field to a View
- Step 6: Create a Workflow
- Step 7: Create a Document Generation Action
- Step 8: Add a Custom Button to Trigger Generation
- Step 9: Verify Document Generation
- Scenario 1: Generated as Field
- Scenario 2: Generated as Attachment
Step 1: Create Your Template File
First, create the document template that will be used to generate files.
How to Create the Template
- Use Microsoft Word or Google Docs
- Design the document exactly how you want the final output to look
- Add placeholders where SnapApp data should appear
Once completed:
- Export or save the document as a DOCX file
- This file will be uploaded to SnapApp later
Step 2: Document Template Rules (Field Substitution)
SnapApp replaces placeholders in your document with real data when generating files.
1. Referencing Fields from the Current Object
Use double square brackets to insert fields from the current record.
Examples:
- Record ID:
[[id]] - Name field:
[[name]]
2. Using Expressions
Expressions allow you to insert system-level information.
Example:
- Application Name:
<<CURRENTAPP()>>
3. Referencing Parent Records
You can access fields from related parent records by chaining field names.
Examples:
- Parent email:
[[created_by.email]] - Grandparent ID:
[[created_by.created_by.id]]
4. Referencing Child Records
To list data from child records (such as tasks), use a START and END block.
Example:
<<START:tasks>>
<<[[subject]]>>
<<END>>
This will generate a list of all related task subjects.
5. Referencing Other Objects Using SELECT
You can pull data from other objects using the SELECT function.
Example:
<<START:SELECT('templates','*','id','43a31a89-4efe-4f46-a99f-4d31ae740184',dictionary=True)>>
<<[[id]]>> <<[[name]]>> <<[[created_on]]>>
<<END>>
6. Using SELECT with Filters
You can filter results using conditions.
Example:
<<START:SELECT('activities','*',filters=[('type','Email','='),('created_by',[[created_by]],'=')],order_by='id',dictionary=True)>>
<<[[subject]]>>: <<[[body]]>>
<<END>>
7. Using Fields Inside SELECT Queries
You can dynamically substitute values inside SELECT queries.
Example:
<<START:SELECT('templates','*','id',[[id]],dictionary=True)>>
<<[[id]]>> <<[[name]]>> <<[[created_on]]>>
<<END>>
8. Adding Images
To display an image stored in a record:
[[IMAGE:image]]
9. Conditional Logic (IF / ELSE)
Use conditions to show or hide content using if, else, endif.
Example:
<<IF:ISBLANK([[image]])>>
This is no image for [[name]]
<<ELSE>>
This is an image for [[name]]. Here it is:
[[IMAGE:image]]
<<ENDIF>>
10. Tables with Child Records
Example table using child records:
| Subject | Status | Priority | Due Date |
|---|---|---|---|
<<START:tasks>> |
|||
<<[[subject]]>> |
<<[[status]]>> |
<<[[priority]]>> |
<<[[due_date]]>> |
<<END>> |
11. Tables with External Records
Example table using SELECT:
| ID | Name | Date |
|---|---|---|
<<START:SELECT('templates','*','id','43a31a89-4efe-4f46-a99f-4d31ae740184',dictionary=True)>> |
||
<<[[id]]>> |
<<[[name]]>> |
<<[[created_on]]>> |
<<END>> |
Once your template is ready, export it as a DOCX file.
Step 3: Create the Template Record in SnapApp
- Go to Settings → UX → Templates
- Click Add New
- Select Document as the Source
- Upload the DOCX template file
- Enable the Active checkbox
- Click Save
Step 4: Create a Generated File Field (Optional)
If you want to store the generated document in the object:
- Open the object configuration
- Create a new field
- Set the field type to File
- Save the field
This step is optional if you prefer storing generated documents as attachments instead.
Step 5: Add the Generated Field to a View
- Open Settings → UX → Views
- Edit the view where the document will be generated
- Add the File field created in Step 4
- Save the view
This allows users to see and download the generated document directly.
Step 6: Create a Workflow
- Go to Settings → Automations → Workflows
- Click Add New
- Set the Type to
API(for button-triggered workflows) - Select the object that will trigger document generation
- Set the workflow status to Active
- Save the workflow
Step 7: Create a Document Generation Action
- Go to Settings → Automations → Actions
- Click Add New
- Enter an Action Name
- Select Document Generation as the Action Type
- Choose the previously created Template
- Select the Generation Location:
- Field → Stores document in a File field
- Attachments → Stores document as an attachment
- If using Field, select the File field
- Choose output format: PDF or DOCX
- Select the Workflow
- Click Save
Step 8: Add a Custom Button to Trigger Generation
- Go to Settings → UX → Views
- Open the desired view in the View Builder
- Add a Custom Button
- Provide:
- Button Name
- Icon
- Target: Background
- Select:
- Action, then choose the document generation action OR
- Workflow, then choose the workflow
- Enable Active
- Save the view
Step 9: Verify Document Generation
- Open a record using the view with the button
- Click the document generation button
Scenario 1: Generated as Field
- The File field will display a link to the generated document
Scenario 2: Generated as Attachment
- The document will appear under the Attachments section of the record
Thank you for following these steps to configure your SnapApp components effectively If you have any questions or need further assistance, please don’t hesitate to reach out to our support team. We’re here to help you make the most out of your SnapApp experience. For support, email us at snapapp@bluevector.ai.