This document walks you through a typical Formstack Documents for Salesforce (sections 1-2 – skip if Salesforce not involved) and Formstack Documents (sections 3-5) end-to-end process and configuration, with supporting documentation in 5 sections:
- Salesforce Configuration - Installation, Salesforce Objects, Permissions, Files
- Generating a Document - via a button or automation
- Document Setup - approach to building templates & merge fields; data routing is used for more advanced business logic
- Formstack Sign - optional for routing for digital signature
- Deliveries - options for delivering merged documents, including back to Salesforce
For orientation, the red circles highlight where this content focuses:
The below is intended to be a starting point and not an exhaustive list.
The overall concepts here are:
- You can setup Document Templates, with a variety of template options (our own builder, Fillable PDF, Word, PPTX, Excel)
- You use Merge Fields in the templates to define data-driven elements
- You can use Modifiers or Rules in the templates to control conditional logic and formatting; you can also setup Looping to loop through child records e.g. to build dynamic tables
- Advanced functionality is Data Routing when you want to have logic to control which document template will be used (based on a data-driven choice)
- You Map your merge fields to Salesforce fields, using interface to map from primary & child objects (for whatever fields we can pull back via Salesforce API) and SOQL for more complex data structures
- Merges can be triggered via a button on any object; via Flow; or via a form-fill
- Document Deliveries are integrations for the destination for a document after it’s merged
- Salesforce Configuration
-
Triggering a Merge
- The two most common methods are:
- Button (Manually) - Standard Objects included by default
- Flow - via automation
- Merge Using Apex (Advanced Option)
- If receiving data from Forms for Salesforce, the Flow option is the most likely config for sending data to Documents (e.g., upon record creation or upon record update)
- The two most common methods are:
-
Document Template Setup
-
Field Map
- Think of the Field Map like a “preprocessing tool” → it always occurs before the merge happens, which allows you to apply field modifiers, include logic outside of the template, encode/decode JSON data, build your own arrays, include default values, etc…
- Template Configuration
-
- Merges:
- Merge Fields
- Counting Merges
- Choosing Template Type
- Customize Templates:
- Merge Field Modifiers
- Conditional Logic
- Looping
-
Embed Image / Signature:
- Note: different for PDF
- Debug / Troubleshooting
- Video walkthrough:
- How to setup Formstack Documents on Salesforce
- Documents 101
- Tips for Creating Your Very First Document (3rd party video)
- Data Routing in Formstack (3rd party video)
-
- Data Routing (if multiple templates or combining remote files)
-
Combine documents or other files:
- Can select to combine (for a single file/packet) or not combine to send separate files together
- Can use logic to determine which templates are triggered → e.g., can have a “Texas” vs. “California” document with state-specific language
- If integrating with Forms, can create a merge field in a data route rule that maps to a file upload field (e.g., photo of driver’s license) to send that/those files along with the same output
-
Combine documents or other files:
-
Field Map
-
Formstack Sign Delivery (optional)
-
Formstack Sign & Salesforce - setting up the delivery
- NOTE: when using Sign, ensure that the Sign tags’ font color is changed to white, otherwise you’ll see the tag underneath the signature
-
Formstack Sign & Salesforce - setting up the delivery
-
Additional Deliveries
- In addition to eSign, you can send merged documents to dozens of native integrations (e.g., DropBox, Google Drive, email, SFTP, etc…) as well as a host of other integrations available via Zapier (which requires a separate subscription) and webhooks (for custom integrations, like a database).
- NOTE: Documents, by itself, never stores merged outputs and only temporarily stores data if debug mode is enabled. If a file is lost or deleted, it will need to be re-merged.
- NOTE: when combining other deliveries with an eSign product, you will likely want to go to the +More Options tab in the eSign delivery and select the “delay other deliveries” option to ensure that the signed copy is what’s stored
- If this isn’t done, then because of the order of operations, an unsigned copy will be sent immediately and may cause compliance or legal headaches
- In addition to eSign, you can send merged documents to dozens of native integrations (e.g., DropBox, Google Drive, email, SFTP, etc…) as well as a host of other integrations available via Zapier (which requires a separate subscription) and webhooks (for custom integrations, like a database).
This guide was created in collaboration with the Formstack Partner Team. To learn more about our team, click here.