With Formstack, you can replace your Salesforce web-to-lead, web-to-case, or web-to-anything forms with a Formstack form. This allows for more control over the form, prevents spam, and uses client-side validation. You can also use Formstack functionality such as Routing Logic, customized messages, multiple redirect URLs, and more.
Although this article takes you through how to setup and add the Salesforce integration to your Formstack Form for the first time, we also offer a native Salesforce tool that allows you to build and customize a form inside your existing Salesforce ecosystem. If you'd like more information on this separate product, please reach out here to get in touch with our sales team or here if you'd like to see it in action.
Article Contents:
Note: To use the Salesforce API, your organization must use the Performance, Unlimited, Professional**, Developer, or Enterprise*** Editions. Also, it is recommended that you create an API-only user at Salesforce and that you create a security token to use with the API. Also, note you must have API access on your professional account in order to use our integration. The Enterprise Edition of Salesforce must utilize the Salesforce Partner API. To verify the version of API in your Salesforce Edition, please check the API settings in your Salesforce account.
Add Salesforce integration
Step 1: Turn on integration. Add the Salesforce integration from your Settings tab and choose "Integrations" from your left-hand panel. Here, use the search bar or select the CRM option to locate "Salesforce" from the options.
Once you select "Add," the Salesforce Integration will auto-populate to add in the needed information.
Step 2: Access Salesforce. Under Account Information, fill in your Salesforce Username, Password, and Security Token.
Step 3: Add in objects. Once your credentials have been added, a list of "Objects" from your Salesforce account will populate. When you choose an "Object" from the list, the fields for that "Object" will appear, and you can map the fields on your form to the fields in Salesforce. You may add multiple "Objects" to your integration setting and remove them at any time.
Note: If you are sending file attachments to Salesforce, you must store your data in the Formstack database or those files won't be transferred. To see more on adding attachments to your Salesforce integration, please click here.
Step 4: Optionally, check the upsert for qualifying fields. If you integrate your form with Salesforce, you can update records via certain objects if that object data already exists rather than create a new record every time.
A common upsert is the Email Address Field. If you include an Email Address Field on your form and check the "Upsert" option in the Salesforce integration settings, records will be updated via the email address if a record already exists with that email address attached. However, if you don't check upsert then a new record will be created upon each submission.
Another common use-case is upserting a Contact: From your Case object, choose Link for the Contact ID field and select the Contact object that you will add to the integration (ie: Contact 1). On the Contact object, select the upsert checkbox next to the Email field. While this will create a new case for each submission, it will only create a new Contact if the one with the email address provided does not exist. If one match is found, the matching record will be updated/upserted.
Note: Fields that Formstack recognizes as upsert-enabled are determined by Salesforce. We do not have a way to edit or force a field to upsert.
Troubleshoot Salesforce integration
More than one matching record found
If more than one matching record is found, the integration will return an error from Salesforce. Remove the dupe record within Salesforce then re-run the integration in Formstack.
Re-run
If an integration fails upon submission, check your integration settings for errors in API or login credentials or in the mapping of form fields.
Then, click on any submission within your form's Submissions tab. Expand the "Integration Status" and click "Run Again." The integration will run and verify it is successful with a green "Success" or a red "Failed" message. If failed, review your integration settings and set up for errors then try re-running again.
Refreshing Your Salesforce Integration
Refreshing your Salesforce integration can resolve various issues, such as submission errors or data not syncing correctly. Follow these steps to refresh your integration:
Step 1: Remove the Existing Integration
Access Integration Settings: Navigate to the integration settings in your application.
Remove Integration: Locate the "Remove" button at the top right corner of the integration settings page. Click it to completely remove the existing integration.
Step 2: Re-add the Integration
Return to Integration Hub: Go back to the integration hub or marketplace within your application.
Add Integration: Find the Salesforce integration and add it again. Follow the prompts to authenticate and configure the integration as needed.
Step 3: Resend Submissions
Resend Data: After re-adding the integration, attempt to resend any submissions that previously failed. This can often resolve issues related to data not being pushed to Salesforce.
Error Troubleshooting
Two common errors you may experience when using this integration:
1. We are getting the following error: There was an error submitting the form. Salesforce error: REQUEST_LIMIT_EXCEEDED: TotalRequests Limit exceeded.
Salesforce will set limits on the number of API calls that can be placed within a 24-hour period. This particular error is generated from Salesforce and indicates a limit has been reached. To get a precise number of how many requests Salesforce is able to make, you may need to get in touch with Salesforce support, as it is dependent on your edition level of Salesforce as well as how many and what kind of licenses you have on your Salesforce account.
2. We're getting an "HTTP 500 Internal Server Error - this page cannot be displayed" message when we try to submit the form with attachments totaling over 5MB.
This error is caused by the Salesforce attachment size limitation. Currently, Salesforce caps files at 5MB when sent through the API, which is what is used in the Formstack integration. The Salesforce restriction is documented here.
Unfortunately, this is a setting/restriction within Salesforce. Therefore, we are limited on what we can do to allow the attachments to process through. The form and Formstack database should not have any issues handling uploaded files. Rather, the type of issue occurs when the data hits the Salesforce API.
Further error messages and suggested troubleshooting steps for our Salesforce integration can be found here.
Missing fields within the Salesforce Integration tab
The Formstack Forms to Salesforce integration utilizes the fields available in the Layout to present the available fields in an intuitive format. This means that for mapping fields to populate within the Formstack integration tab they will be required to be included in the assigned layout on the object. If the mapping fields are not populating within the integration tab then you may need to update the assigned page layout for the profile used by your integration to a different layout that contains all the fields you're looking to use, or update the currently assigned layout to include those fields.
Handling Restricted Picklist Errors
Restricted picklist errors occur when a value not defined in Salesforce's picklist is used. Here's how to address this issue:
Step 1: Check Picklist Settings
Salesforce Setup: Log into your Salesforce account and navigate to the object where the error occurred.
Review Picklist Field: Locate the picklist field causing the error. Ensure that "Restrict this picklist to the values defined in the value set" is not enabled if you need to use values outside the predefined list.
Step 2: Update Picklist Values
Modify Values: If necessary, add the required value to the picklist in Salesforce to prevent future errors.
Addressing Field Length Errors
Field length errors occur when data exceeds the maximum allowed length for a field in Salesforce. Follow these steps to resolve this issue:
Step 1: Identify the Field
Error Message Review: Check the error message to identify which field is causing the issue. For example, "Job Address (City): data value too large."
Step 2: Adjust Data Input
Modify Data: Ensure that the data being submitted does not exceed the maximum length specified in the error message. Consider splitting data into multiple fields if necessary.
Step 3: Update Salesforce Field
Salesforce Configuration: If possible, increase the field length in Salesforce to accommodate the data being submitted.
Security Token
Refresh your Salesforce security token via the Salesforce user interface if needed. Salesforce will send a new token to the email address on the user's Salesforce record.