Setting Up Automated Survey Triggers from Salesforce to AskNicely
This guide walks you through the initial setup required to trigger surveys automatically from Salesforce into AskNicely.
Step 1: Create a Lookup Field for Opportunities in AskNicely
- Navigate to the AskNicely Response Object.
- Create a lookup field for Opportunities.
- Name the field appropriately (e.g.,
Opportunity
). - Ensure the field is fully visible so all users can access it.
Step 2: Add an Opportunity ID Field to the Contact Record
- Create a placeholder field on the Contact record to store the Opportunity ID.
- Name the field consistently with existing API object IDs (e.g.,
SF Opportunity ID
). - This field will be used for mapping in the Salesforce integration.
Step 3: Map Fields in the Salesforce Integration Page
- Navigate to the Salesforce Integration Page in AskNicely.
- Go to the Updates Tab.
- Map the Opportunity field from the AskNicely Response Object to the Opportunity ID field on the Contact record.
- Ensure proper mapping to enable automated survey triggers.
Step 4: Modify the Opportunity Object in Salesforce (If Required)
Salesforce’s Opportunity object setup varies, and additional modifications may be required:
- Create a Lookup Field from Opportunity to Contact:
- Name it something like
Primary Opportunity Contact
. - This ensures each Opportunity is linked to a Contact for survey purposes.
- Name it something like
- Create a Formula Field for Contact Email:
- Auto-fills the email address from the linked Contact.
- Ensures the email is available for survey distribution.
- Especially useful if your email templates lack a merge field for email.
Required Field Names for API or Email to Survey Integration
When using our API or email-to-survey functionality, the following field names must be used exactly as written:
- name: The contact’s full name
- email: The contact’s email address
- firstname: The contact’s first name
- lastname: The contact’s last name
- segment: AskNicely’s internal segment field (optional)
- sfcontactid: The Salesforce Contact ID
- sfaccountid: The Salesforce Account ID
- txn_sfcaseid: The Salesforce Case ID
- sfleadid: The Salesforce Lead ID
- delayminutes: The number of minutes to delay survey delivery
- triggeremail: Set to
true
to override the global contact rule in AskNicely - sfopportunityid: Recommended naming convention for Opportunity ID, as there is no default name for it
Summary
This initial setup ensures that Salesforce can correctly link Opportunities to Contacts and send the necessary data to AskNicely for automated surveys. If you need assistance with customizing your Opportunity object, reach out to the support team.
Next Steps
In the next guide, we’ll cover how to build the email template for survey distribution.