Want to set up Formstack Documents with Salesforce? This guide walks you through everything from installing the package, configuring settings and mappings, to adding buttons in your layouts — so you can generate documents directly from your Salesforce org.
If you’re new to Documents for Salesforce, start with the Install section below. Already installed? Jump to Settings, Mappings, or Buttons to complete your setup.
Install Formstack Documents for Salesforce
To get started with Formstack Documents for Salesforce, you will need to first install the package in Salesforce.
Step 1: Navigate to the AppExchange and search for "Formstack Documents" or go to https://appexchange.salesforce.com/listingDetail?listingId=a0N3000000B53bmEAB to get started.
Step 2: Sign in as a Systems Administrator for the Salesforce Org that you’d like to install Formstack Documents on.
Step 3: Once logged in, review the details and click Confirm and Install to add.
Note - Grant Permission Set
In version 1.339, we introduced permission sets to control access to the application. After installing the package or upgrading your Formstack Documents for Salesforce app to v1.339 or later, you must assign the new permission sets to any users who need access. Users who do not have the necessary permission sets will receive an error when attempting to use the application. For details on setting up and assigning permission sets, please refer to our User Profile Permissions (/hc/articles/44592105243667).
Access Formstack Documents for Salesforce
To access Formstack Documents for Salesforce, click on the waffle icon in the top left corner of Salesforce and search for "Formstack Documents":
Formstack Documents for Salesforce gives you access to three new tabs:
- Formstack Documents
- Formstack Mappings
- Formstack Settings
Here you will be able to manage your Formstack document mappings and settings.
Formstack Settings
To give Salesforce access to your document templates, set up an API Key and API Secret in Formstack Documents.
Step 1: Visit https://www.formstack.com/products/documents and either sign in or create a new account.
Step 2: Under your Profile, click on API Access.
Step 3: Click on Click here to create an API Key! to get started.
Step 4: Name your API Key.
Step 5: Copy and paste the API Key and API Secret from Formstack Documents into Formstack Documents for Salesforce.com settings.
Step 6: Click Login to Formstack Documents using your new API credentials.
If everything was entered correctly, you’ll be logged in!
Document Management
Once logged in to Formstack Documents, the Formstack Documents and Formstack Mappings tabs are accessible to manage.
Click on Formstack Documents to view full access to your Formstack Documents account. You can create new Documents or Data Routes within Salesforce to be available within the Formstack Mappings tab.
Documents for Salesforce Mapping Guide
Documents for Salesforce allows you to create Formstack Document mappings using data from Salesforce records. This allows the ability to take almost any piece of record data in Salesforce and easily have it merged onto a Formstack Document.
Create Field Mappings
Step 1: Click New Mapping to start.
Step 2: Fill out the details on the New Mapping screen:
- Mapping Name: Give this mapping a name that will be descriptive to you and your users.
- Description: Give users a description of what this mapping does or what use case it was created for.
- Salesforce Object: Select a Salesforce standard object with which you’d like to merge the document. Documents for Salesforce currently supports: (Account, Contact, Lead, Opportunity, Case) You can easily add support for custom objects. Please refer to this guide on how to add those objects.
- Select a Formstack Resource: Documents allows you to create Documents or Data Routes. You can toggle between both types of resources here. Selecting Documents will give you access to a list of available, active Documents in Formstack Documents.
- Select a Document (or Route): Select the specific Document or Data Route from Formstack Documents you’d like to create a mapping for.
Step 3: Click Save and Next to continue on to Field Mapping.
Once you have a Formstack Mapping, Formstack Fields from the document template can be mapped to existing Salesforce fields on the Salesforce object.
Clicking in the field under “SALESFORCE FIELD” brings up several options:
You can visually drill up or down the Salesforce data structure by choosing 1) a source, 2) a relationship, and 3) a field.
Select the Salesforce Field that you want to map to each Formstack Field. As you are doing this, you will have access to:
- Fields from the selected Salesforce Object
- Fields from parent records like Owner, Account, etc.
- Child Relationships. See Working with Child Relationships for more information on using Child Relationships in your Formstack documents.
Note: If you do not see your field in the dropdown, you always have the option to manually enter in the API field name of the object in the “Salesforce Field”. When saved, you will see the API Name you entered change to the label name.
Bonus Mapping Features
SOQL
You have the option to create SOQL queries in those fields to allow customization over the data you are pulling from Salesforce. This is done by typing “<< SOQL >>” and selecting it in the Salesforce Field. If you need more information on SOQL queries, please see this article: Use SOQL Queries
Custom Formstack Fields
Formstack Documents allows you to add special ad hoc fields to your mappings. These are great for when you need to map over information at the time of the document generation, but needs to be input by the party generating the document. To access these fields, all you have to do is start typing, "<<" in the mapping and this list will show.
Once you select the type of field you need for your use case, you will be given the opportunity to customize that field, eg. Adding options for check boxes or radio buttons, or drop downs.
Once you have added your custom field and completed the rest of the setup, you will then find your custom field available to you when you go to generate a document from a record.
Automatically Generate Documents
With Formstack Documents, you can automatically have a Formstack Mapping generate a document when specific criteria are met.
Note - If you are looking for a more robust way to automate document generation within Salesforce, you can use Flow to automatically generate Formstack Documents. This article walks through how to set up a Flow to trigger document generation.
Evaluate the following rule when a record is:
- Created: this will evaluate the rule every single time a record is created. If the rule criteria are met, the document will be created.
- Created, and every time it’s edited: this will evaluate the rule every single time a record is created and every single time the record is edited. If the rule criteria are met, the document will be created.
- Created, and any time it’s edited to subsequently meet criteria: this option will evaluate the rule every time a record is created and every time the record is edited and did not previously meet the criteria.
Once you’ve selected the evaluation criteria, you can choose up to four criteria that must be met in order for the document to be generated automatically. You have access to the fields on the Salesforce Object that you selected when creating the Formstack Mapping as well as fields from parent objects like Owner.Name or Account.Name.
Activate and Deactivate Formstack Mappings
As you build your Formstack Mapping, you can save it and return to it at any time as you gather requirements and design your document in Formstack Documents. If you are working with new mappings, you can Save or Save & Activate. If you choose to Save, you will be able to activate the mapping later.
Activated Mappings
Once you activate a mapping, it will be available to your users through the WebMerge button on a record. If your mapping has been configured to automatically generate documents, those rules will now be active as well.
Add Formstack Documents Buttons to Salesforce Page Layouts
Not only do you have the option to set up criteria for generating documents automatically, but users can also generate documents on demand using the Formstack Documents button on a Salesforce record. The objects currently supported by Formstack Documents are Account, Case, Contact, Contract, Lead, and Opportunity.
Note: If you are using a Custom Object or Non-Standard Object, please read this article.
Step 1: Load the object in Object Manager and select the Page Layouts option in the left pane.
Step 2: Click on the Mobile & Lightning Actions section to view the Merge Document button.
Step 3: Drag the Merge Document button into the Salesforce Mobile and Lightning Experience section of the Page Layout.
Step 4: Save the Page Layout to see the Merge Document button on the detail record. Repeat this for each of the supported Salesforce objects.
Note: Adjustments made in Page Layouts will not automatically reflect if you are using the Lightning App Builder for custom pages in Salesforce.
Here’s the distinction:
- Page Layouts: These control the arrangement of fields, sections, buttons, and related lists for both viewing and editing records in the standard Salesforce interface. Page Layouts apply universally to record types, regardless of whether you're in Lightning Experience or Classic.
- Lightning App Builder Pages: These are custom pages you create in the Lightning App Builder, which allows for more advanced customization beyond just fields. Here, you can add components, such as custom Lightning components, lists, reports, charts, etc., that are not part of the traditional Page Layout.
In summary:
- Page Layouts control the data and its organization in record detail pages.
- Lightning App Builder pages give you the ability to design entirely custom pages with more flexibility and advanced components, which may or may not include the elements from Page Layouts.
- Solve: If you want the changes made in a Page Layout to appear on a custom Lightning Page, you need to ensure that the fields, sections, and components from the Page Layout are included in the Lightning page configuration.