Integrating SurveySparrow with Salesforce
Capture new leads, trigger personalized surveys to customers whenever an event occurs, map those responses back to the Salesforce fields.
The Salesforce integration with SurveySparrow lets you seamlessly initiate surveys based on an event occurring in Salesforce, map survey responses back to the Salesforce fields & manage all the leads in one place. Using this integration, take proactive measures to transform your leads into customers and enrich your overall customer relationship management process.
With the Salesforce integration, you can:
- Capture new leads.
- Enrich leads to improve data quality.
- Import Salesforce contacts in your SurveySparrow account, send surveys to them, and map the responses back to your Salesforce account.
- Trigger CSAT or Transactional NPS surveys after every touchpoint in the customer lifecycle, and map the scores back to your Salesforce account.
- Collect survey responses in Salesforce and build real-time reports and charts.
Note: To track CSAT and NPS scores, create a Custom Object on your Salesforce account.
Things to note before you begin:
- Supported Salesforce editions: Enterprise, Unlimited, Performance
- Authentication method: OAuth 2.0
- Salesforce permissions required: Author Apex and read/write access to fields and object for configuration and response writing
- We recommend that your organization have a dedicated integration user who you can connect with for this implementation.
- The native integration supports both production and sandbox environments. If you would like to know how to migrate your triggers and mappings from sandbox environment to your production environment, check this article.
- When you set up the integration, here's what gets installed in your Salesforce org:
- When you create a survey trigger via SurveySparrow, a corresponding Apex trigger is created in Salesforce
- For all the triggers that you create, a shared helper class is created in Salesforce, with a single
@future(callout=true)method. Whenever a survey is triggered, the helper class pushes the details of the from Salesforce to SurveySparrow (via API). - A remote site setting (if it isn't already added).
- The trigger only reads and does no DML. Check the FAQ for per-transaction limits.
- We also have an AppExchange app that you can configure within Salesforce to create triggers and mappings. If that suits your requirement better and to understand how it works, check out this article.
Trigger surveys based on an event
Here’s how the Salesforce integration helps you automate sending surveys when an event happens in Salesforce.
1. After logging into your SurveySparrow account, create a new survey or open an existing one. Navigate to Integrate tab & enable the Salesforce toggle.

2. Enter your Salesforce credentials and authorize access to your SurveySparrow account.

3. Once the integration is enabled successfully, navigate to Salesforce and enable the toggle - “Trigger Survey when an event happens in Salesforce”.


4. Choose an Event: Set the object for which you want the survey to be invoked.
Note: You can choose custom objects as well.
5. Choose an Action: Once the object is selected, decide whether you want to create or update the existing fields
6. Add conditions (if any)
Note: Enter the condition(s) to have complete control over the respondents. Fill in the “Field”, “Operator” and “Value” slots. If you were to enter multiple conditions, then the survey is initiated only if all the conditions are met.
Eg: Trigger surveys automatically when the “case”
- The status is resolved, and
- Priority is not equal to low.
Each related object referenced in a condition adds one SOQL query to the transaction.
7. Enter the email address/addresses: Type in the email addresses of the recipients to whom you want the surveys to be sent out.
8. Choose share channel: Select the email share channel to which you want your surveys to be rolled out.

Once you have filled in all the appropriate fields, click “Save” to complete the action.
What happens when you click Save:
- SurveySparrow validates the configuration.
- It connects as the connected user and adds the remote site setting if missing.
- It creates or updates the helper class.
- It generates the trigger source and deploys it through the Salesforce Tooling API.
Note: For NPS surveys, you can pass the desired object variables to the surveys you invoke.
Mapping responses to Salesforce fields to capture new leads
To map survey responses back to the Salesforce fields, Select “+New Mapping” and follow the procedure below.

1. Choose the Mapping type: Decide whether you want to create a new entry or update an existing one
2. Select the Salesforce object: From the drop-down list, select the object to which you want to be mapped back.
Note: You can select custom objects as well.
3. Map your Salesforce fields: Enter the field Type, Select the Question, Salesforce Field, and Default value you want to map. You can enter as many fields as you require.

Eg: Map the following survey responses back to your Salesforce account when the object is “Contact”:
Suppose the object is “contact”, the selected survey responses will be mapped back to your Salesforce fields.
The responses customer submits for these questions will be directly added to the designated Salesforce Fields.
Once you’ve added the fields, select Save to complete the mapping process.
Note:
- If you have mapped multiple SurveySparrow fields to the same Salesforce field, the first valid answer will be sent to Salesforce.
- For the Contact object, mapping the “LastName” field is mandatory
- Response write-back runs as the connected user through the Salesforce REST API.
- A mapping can use up to two Salesforce API calls per submission
Import Salesforce contacts to SurveySparrow Audience
1. From your survey settings, navigate to Apps and integrations. Select Salesforce and then import Contacts. Select the contacts you wish to import.

2. Map the required contact fields from Salesforce, name your import, assign a new label and enable the recurring import toggle button if you wish to import the contacts on a daily/weekly/monthly basis.

3. Click “Finish import” to complete the process.


You have now successfully imported the contacts from Salesforce.
If you wish the disable the integration, switch off the Salesforce toggle on your Integrate tab.

And that's it! That is how the SurveySparrow-Salesforce integration can be configured for your requirements.
Please reach out to us if you have any questions. We are just a chat away!
Salesforce integration pricing/availability
SurveySparrow’s Salesforce integration is not available as a free feature. Pricing/availability can vary based on your plan and use case. For exact pricing, refer to the SurveySparrow pricing page or contact Sales/Support with your requirements (expected response volume, number of users, and the Salesforce objects/fields you plan to sync).
Frequently asked questions:
- Does the integration install code in my Salesforce org?
Yes. One Apex trigger per survey trigger plus one shared helper class, deployed when you click Save. - Will it conflict with my existing Apex triggers or Flows?
It’s a separate trigger, it only reads, and it does no DML, so it doesn’t change your existing trigger code. It does use your transaction’s governor limits (see 3). - Does it use Platform Events, Queueable Apex or scheduled jobs?
No. The trigger hands off to one@future(callout=true)method. - What governor limits does it use? Per matching record: 1
@futurecall (limit 50) and 1 SOQL query per related object in your criteria (limit 100). No DML. The HTTP callout runs outside your transaction. - Does it use my Salesforce API calls?
When a trigger is created, it generates the trigger source and deploys it through the Salesforce Tooling API. But when a trigger fires, it doesn't use the Salesforce API. Response mappings can use up to two per mapping per submission. - What happens if the survey call fails?
No retry. It’s logged toSystem.debugand that record gets no survey. - What happens if write-back fails?
Three retries over 150 minutes for network errors, 401, 429, 5xx and record locks. - Which Salesforce editions are supported?
Enteprise, Unlimited, Performance. - What permissions does the connecting user need, and what happens if that user is deactivated?
Permissions needed: Author Apex and read/write access to fields and object for configuration and response writing. When the user is deactivated, the response push breaks as it writes the response in the connected user's context. - What governor limits does the integration use?
For each record that matches your trigger criteria, the integration makes 1 @future call (Salesforce limit: 50 per transaction) and 1 SOQL query per related object used in your criteria (limit: 100 per transaction). It performs no DML, and the HTTP callout to SurveySparrow runs in the future call, outside your transaction. - Can I use custom objects?
Yes, you can use custom objects when setting up triggers and mappings. - How do I turn it off?
Remove the triggers in Salesforce first. But mappings can be disabled right from SurveySparrow. - How do I troubleshoot a survey that didn’t send?
Check your criteria and the debug log. Head to Setup, then search for Apex Jobs. After opening it, look for the SurveySparrow<>Class, where <> contains your account ID. - Is it included in my plan?
Plan availability can vary based on your use-case, please reach out to our sales/support team to get started.
Was this helpful?
