Skip to content

Trigger a survey to a list of contacts in Salesforce

In this documentation, we will guide you through the process of sending a survey to a list of contacts in Salesforce.

This will include:
- Creating a list of contacts in a Salesforce Report
- Creating a Salesforce Campaign
- Creating a Process Builder, that triggers the survey on an added Campaign Member
- Adding the list of Contacts to a Campaigns and sending out the survey

Prerequisites

Create a campaign via the nps.today platform and obtain the CampaignID of the Campaign that needs to trigger a survey.

CampaignID

In this example – the CampaignID is 13544  

Setting up a list of contacts in Reports

Start by creating a list of all the Contacts in Salesforce, that you want to receive a survey from nps.today.

Salesforce Reports

Create a Salesforce Campaign

Now create a Salesforce Campaign. This Campaign will later be used for adding the contacts from the Report as a Campaign Member, which then triggers a survey.

Salesforce Campaign

Create a Process Builder

Now you need to create a process in the Process Builder, that will trigger a survey, when a Campaign member is added to a specified type of Salesforce Campaign, that you decide.

Another way to go about this is to create a Salesforce Flow, but this guide will use the Process Builder. Ask your Salesforce Admin if a Salesforce Flow is preferred.

Create the Process

The Process starts when “A record changes”: New Process

Find the Object

Select “Campiagn Member” as the Object and start the process “when a record is created or edited”.

Find Object

Add Conditions

Create the conditions for the process to be validated. In this caseThe Campaign Type needs to be a “Direct Mail” with the status “Completed”.

Add Condition

Create the Action

Create an “Immediate Action” and add the following content:

Apex Class: Request NPS Rating

Respondent (ContactId): [CampiagnMember].ContactId

NPS Campaign Id: The nps.today CampaignID fount in the prerequisites section of this document

Add NPS Apex Action

You will also be able to add data like a What-Id (often the ID of the Salesforce Campaign), Responsible employee, other Custom data written in JSON code.

Save and Activate the Process.

More information about the Apex Variables here
Apex Variable Description
NPS Campaign Id The ID of the campaign you need to target in nps.today.
Respondent The Respondent, that need to receive the NPS survey
What-Id The ID of the record you need to refer to. In above example it is the Case Id because we are sending out an NPS after a case is closed
Responsible The Responsible of the customer receiving the NPS Survey. In above case it is the responsible of the case, the Case Owner. In other situations, in could be the contact owner or the owner of the Account the Contact is related to.
Custom JSON Here you can use JSON coding to ad any kind of Salesforce data in the NPS.Today custom field. This field accepts any valid json. We do not perform any actions on this information other than storing it and returning it to you on request. Limited to 8kb or nvarchar(4000)

Send out the survey

Not that you have the set-up ready you can add the Contact list in your report to the Saleforce Campaign. Go to your report and click “Add to Campaign”.

Add Contacts To Salesforce Campaign

Select your Campaign and Member Status and click “Submit”.

Submit

Now a survey will be triggered by the Process Builder.