Skip to content

Installing your Salesforce Plug-in


Salesforce features

This document describes how to setup and operate the “np.stoday for Salesforce” app used to make selected features available from within Salesforce.

The intended audience for this document is Salesforce Admins with basic configuration experience.

Note that the User setting up “NPS.Today for Salesforce” needs to have the right Permissions set from the chapter Grant access to users.


Basic install

After completing the following steps, your instance is connected to your Salesforce instance, but no features have been made available to end-users through user interfaces or automations.

Install package

Install the package using the installation link provided by your contact by. Install through your preferred method – end result is the same:

Browser install
- Log into the Salesforce environment you want to install to
- In your browser URL paste in the install link.

The package alias can be found on the update site, where you will findthe latest version of the app.
- Follow the standard Salesforce package install process. Select “Install for Admins Only”
- After the installation is completed, you’ll end up here:

Browser install

SFDX CLI install

sfdx force:package:install -u <sfdx org alias> -w 1000 --securitytype AdminsOnly -p <04t… package id received from your contact>

Configure package

Here you will need an API key and a campaign ID from As an admin, access “Setup -> security -> named credentials. Select the NPS environment you wish to call. In most cases the production environment will be selected. Next you need to edit the Named Credentials.
Named credentials

Edit the Named Credential. Named credentials - edit

Insert the API-key generated from the system in the Password section. Click “Save”. Named credentials - password

As an admin, access Setup -> Custom Code (under PLATFORM TOOLS) -> Custom Settings, locate Settings and click Manage. Cusotm setting - Manage

If a “Default Organization Level Value” record exists, edit that. Else create one by clicking New. Remember to click the right one! Cusotm setting - edit

Populate the Default NPS Campaign Id with a Campaign ID number from a Camping in your system. In Case Statuses for Surey write "Closed". Click Save. Edit nps settings

Your configuration is now done!

Run initial sync and schedule periodic sync

Go to the app laucher.
App launcher

Locate the tab NPS.Today Admin.
npstoday admin

Click the Full re-sync button to ensure a full sync of NPS ratings (npstoday__Response__c records) Click Refresh button to follow the job execution in the Sync job executions table.

Job is expected to complete successfully and the Last run record count is expected to reflect the total number of NPS ratings in your system.

Now click the button Re-schedule sync job to schedule NPS rating sync to run periodically and sync new ratings into Salesforce.
Re-schedule sync

Ensure the scheduled execution is added to the “Sync schedule” table.
Sync table

Setup functionality

Each of the following sub sections can be performed independtly of each other and will allow Salesforce end-users to work with features from Salesforce. The setup steps described should be seen as examples of the most typical uses of the for Salesforce app but not a comprehensive list of how the components provided by the app can be utilized by an advanced Salesforce Admin or Developer.

Grant access to users

To grant users access to use access features in Salesforce, it is recommended to rely on the provided permission sets and assign them to relevant users:

Permission set Description viewer Most users should have this permission set or the equivalent rights through other means. Allows user to view data requester Allows user to request requests from individuals admin Allows user to setup and administer the integration to mass requester Allows user to access the UI to request ratings from multiple contacts in one go (list view button)

Go to Setup -> Users (under ADMINITRATION) -> Permission sets
Assign each permission sets to relevant users. Permission sets

Click Permission set -> Manage Assignments -> Add assignments -> assign relevant Users.

Add charts to Account Lightning pages

Edit relevant Account lightning pages (e.g. through Setup -> User Interface (under PLATFORM TOOLS) -> Lightning App Builder – You can also go to a random account and press the “cog wheel” in the top right corner and click Edit page.
Cog wheel

In the Lightning Components sidebar under Custom – Managed you will find the components. If you haven’t deployed a domain, you must do that to access the Custom – Managed components. Click Deploy My Domain and follow the standard Salesforce process. Manage donmain

When your domain is deployed you should see the components in Custom – Managed. Drag them into the page wherever you like. The following components are available: Custom Managed

We have two different graph type whereas the below graphs are the newest:
• averageRatingChart
• ratingsChart
• ratingTrendGraph

You are still able use the old ones:
• NPS Rating Distribution
• NPS Rating Trend
• NPS Record Overview

It can look like this: Account view

Press save -> Activate -> Assign as Org Default to add it to all accounts.

Do the same steps on Contacts by going to a random contact and press the cog wheel in the top right corner and click Edit page and drag the Custom – Managed components into the page wherever you like.

The advantage of the new graphs mostly is due to an improved version of NPS Rating Trend. The new graph makes it possible to choose different timelines such as “all time”, “last 6 months”, “last 3 months”, “last month”, and “last week”. It is also possible to pin the timeline on an account or contact page. In the future, these will become our default NPS graphs in Salesforce. You can pin the setting to your Page View:

Pin graph

Show NPS response details on Contact/Person Account detail page

To show details about NPS responses related to a contact, simply add the “NPS Responses” related list to the relevant Contact/Person page layout.

Go to Setup -> Object and Fields -> Object Manager. Select the right Label - Contact.

Now click Page Layout and select the right Page Layout.
Page layout

Now select Related Lists and drag the NPS Responses label down where you want it to be.
Related lists

Press here the to add properties.
List properties

The following columns are recommended as a good default starting point. Put the selected field in the order you want.
Sort by Rating Time as Descending.
Select properties

In the Standard Buttons section uncheck the boxes
Select properties2

Press OK and Save the Contact Layout.

Create button to manually request NPS rating from contact

Here we will show how to add a button on Contacts, that allows Salesforce Users to request an NPS rating (i.e. add a contact to an campaign). To do this you need to create a new Contact Quick Action to invoke a flow.

Navigate to Setup -> Object Manager -> Contacts. Now go to Buttons, Links, and Actions and Create a New Action.
Button - New action

Setup the button as you like. E.g.:

Field Value
Action Type Flow
Flow Request NPS Rating for Contact
Standard Label Type --None--
Label Name accordingly etc. Request NPS Rating
Name Name accordingly etc. Request NPS Rating

It could look like this:
Button setup

To add the quick action to relevant contact navigated to your Contact Layout: Setup -> Object Manager -> Contacts -> Page Layouts -> Contact Layout.
In the Mobile & Lightning Actions section drag your button to the Salesforce Mobile and Lightning Experience Actions and click Save.
Button drag

Now go to a Contact to see if you see the button.
Button page view

Create NPS automations in Process Builder

To be performed by Salesforce Admin with some Salesforce experience. Below example is made in the Process Builder, but similar automations can be made in Flows

From a process builder, flow or other context, invoke the “Request NPS Rating for Contact” or “Request NPS Rating for Contacts” headless flow/invokable method.

Go to Process Automation -> Process Builder -> New in the top right corner. You can now build the processes that gives your company value.

An example is like this – Send a NPS when Case is closed as won:
Process builder example

Above you see how you need to use the “Request NPS Rating” Apex Class to request an NPS. Below is an explanation on what the different Apex Variables is.

Apex Variable Description
NPS Campaign Id The ID of the campaign you need to find in
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 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)

One last thing to remember

As a default in you can’t send surveys to the same contact more than once on a campaign. Therefore, if you want to send multiple surveys to the same contact from a campaign, you must Allow duplicates in the campaign setting on the specific campaign.


It is recommended to monitor the following:
• Apex jobs execute with success (see the “ Admin“ tab or the standard “Apex Jobs” data through the “Apex Jobs” setup page or other means).
• Records in the npstoday__Error__c. For issue free operation, no records are expected to be generated.


Useful tips and tricks to automate your NPS-requests

To be performed by Salesforce Admin with some Salesforce experience. Here are some examples made in the Process Builder, but similar automations can be made in Flows.

Go to Process Automation -> Process Builder -> New in the top right corner. You can now build the processes that gives your company value.

This example create the automation - Send a NPS when Opportunity is closed as “WON”, if you have customers from several countries:

First you need to choose the ight campaign in, that needs to trigger the survey. This could be a "String" with a campaign ID og a “Formula" to choose the right campaign ID according to for example the Contact’s mailing country (if it is a Danish, English or German campaign). With the CASE-function you can just clone the process and insert a new country name and its campaign ID, whenever you create campaigns for more countries in the future.

Other useful automations

• After a meeting with new business customer. NPS is often used in sales to give the salesperson insight, how the meeting went. • After sending a quote to the new customer to give insights if there are any obstacles before making the deal. • NPS xx days before a current agreement expires. It gives an opportunity to make a recovery on dectractors, so they are more likely to re-sign a deal. Very good for subscriptions. After the delivery of a product or a service.