Profile Picture of the author

SnapApp Document Generation

on 01-27-2026 12:00 AM by SnapApp by BlueVector AI

2183

License: Professional, Corporate, Enterprise

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:

  1. Creating a document template
  2. Uploading the template to SnapApp
  3. Configuring a workflow and action
  4. 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

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

  1. Go to Settings → UX → Templates
  2. Click Add New
  3. Select Document as the Source
  4. Upload the DOCX template file
  5. Enable the Active checkbox
  6. Click Save

Step 4: Create a Generated File Field (Optional)

If you want to store the generated document in the object:

  1. Open the object configuration
  2. Create a new field
  3. Set the field type to File
  4. 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

  1. Open Settings → UX → Views
  2. Edit the view where the document will be generated
  3. Add the File field created in Step 4
  4. Save the view

This allows users to see and download the generated document directly.


Step 6: Create a Workflow

  1. Go to Settings → Automations → Workflows
  2. Click Add New
  3. Set the Type to API (for button-triggered workflows)
  4. Select the object that will trigger document generation
  5. Set the workflow status to Active
  6. Save the workflow

Step 7: Create a Document Generation Action

  1. Go to Settings → Automations → Actions
  2. Click Add New
  3. Enter an Action Name
  4. Select Document Generation as the Action Type
  5. Choose the previously created Template
  6. Select the Generation Location:
  7. Field → Stores document in a File field
  8. Attachments → Stores document as an attachment
  9. If using Field, select the File field
  10. Choose output format: PDF or DOCX
  11. Select the Workflow
  12. Click Save

Step 8: Add a Custom Button to Trigger Generation

  1. Go to Settings → UX → Views
  2. Open the desired view in the View Builder
  3. Add a Custom Button
  4. Provide:
  5. Button Name
  6. Icon
  7. Target: Background
  8. Select:
  9. Action, then choose the document generation action OR
  10. Workflow, then choose the workflow
  11. Enable Active
  12. Save the view

Step 9: Verify Document Generation

  1. Open a record using the view with the button
  2. 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.


Generate Text