Recipe to Push NPS Responses to Slack

Userlevel 7
Badge +1
  • Gainsight Employee: ACE
  • 443 replies
I'm very pleased to say that I was able to set up an Advanced Outreach to push our NPS responses to Slack!

Preview in Slack

Click to Expand in Slack

My setup takes the NPS answer, and the answers to two open-ended questions, and pushes them to Slack each morning, for the survey responses submitted the previous day. Partially-submitted responses are still pushed to Slack, and if the participant further edits their response in the future, they will be pushed again.

It took me about a week to figure it out my own, and it should be considerably faster for you, with this path to follow!

Part 1: Set up your Slack Email Address
  1. Add the "Email" app to your Slack instance
  2. Add a configuration called "Gainsight"
  3. I started by having the integration post to me in a direct message, and now I have it set to post to a channel called #customer-feedback (so that I can also push other things there besides NPS, like Zendesk Satisfaction responses)
  4. Customize its icon. I used the Gainsight logo.
  5. Grab the email address that Slack has created for you
Part 2: Populate the Slack email address onto every Account
  1. Create a custom field on Customer (in Salesforce Setup > Create > Objects > Customer Info > Custom Fields > New). Here's my setup for that field:
  2. I have a nightly Rule that updates every Account. I added an Action that populates that field when it's null. Setup shown here:
Part 3: Set up your Survey Data Space

You need a Data Space set up on the "Survey User Answer" object. Do not use the "NPSSurvey Response" object, since that's only populated once the survey is "Submitted", which, if they didn't finish the survey, would be days after the user actually submitted their NPS score, from their perspective. 

Make sure that you include at least these fields:
  1. From Survey User Answer: Answer Title (this is the text of a chosen answer, like a radio button, including the NPS score itself), Answer Text (this is open-ended responses, for any such questions in your survey)
  2. From Survey User Answer > Question: Title (this is the text of the question), Question Number (so you can filter for certain questions)
  3. From Survey User Answer > Survey Master: Title (this is the name of the survey)
  4. From Survey User Answer > Participant: Last Response Record Time (this is when the participant last edited the survey response, even if the response is only partially submitted)
  5. From Survey User Answer > Participant > Contact: Email, Full Name
  6. From Survey User Answer > Participant > Account: Id, Account Name, Slack Email Destination
Part 4: Create an Advanced Outreach, using the "Email" model, and add Participants via a Bionic Query

A simple setup:

The Bionic Query:

  1. Fetch Task: Get your NPS responses from your Survey Answers Data Space. Include all the fields listed above for the Data Space. Filter for only responses from yesterday, and for the right Question Numbers for your NPS question(s). (We technically have two NPS questions in Gainsight, since different surveys go to different customer segments.) My setup:
  2. Fetch Task: Get your open-ended responses from your Survey Answers Data Space. We have multiple open-ended questions per survey, and I wanted them all pushed into Slack. I use a Formula Field (in this screenshot, called "Response for Why") to use the "concat" function to combine a super-short version of the question (in this case, "-- Why? -- ") with the answer text itself. My setup: I have two Tasks like this, each one filtering for a different question.
  3. Transform Task: You want the "From" line of the email that goes to Slack to describe who submitted the response. I use the format "FullName @ AccountName". Use this Transform Task to assemble that text using a Formula Field that uses a "concat" function. My setup: (I'm sorry I can't show the setup of the "concat" Formula Field; publishing an Advanced Outreach apparently locks you out out of viewing Formula fields in its Bionic Query.)
  4. Merge Task: Combine your NPS responses with the text from an open-ended question. My setup:
  5. Merge Task: Combine the results of the first merge with the answers to the other open-ended question. My setup:
  6. Merge Task: Combine the results of the previous merge with that "FullName @ AccountName" info. My setup:
  7. Don't forget to Schedule it! My setup:
Part 5: Configure the rest of the Sources setup
Back in the "Sources" area:
  1. You want the same participant to be able to enter the Advanced Outreach an unlimited amount of times. My setup:
  2. Some of the standard fields can be useful, but you'll also create custom fields for question responses and so on. My setup:
Part 6: Set up your email template
  1. The template should be SUPER SIMPLE. Slack does not even respect line breaks. The hardest part here is making sure that there are not an awkward number of spaces (or lack of spaces) between different info. I was careful about adding spaces to the "concat" actions in the Bionic Query. Include default values for all the tokens; I used periods for the comment questions, which a participant may leave empty, especially if they've only partially filled out the survey. My setup: If someone doesn't submit any comments in my setup, their response comes through like this: [img][/img]
  2. In the Advanced Outreach, configure the email template and your mappings. Keep in mind that you'll see here that "Recipient Email Address" is selected as the "To", but, in my Sources setup above, I set it to be populated by the "Customer Slack Email Destination" field. My setup:
Now publish that sucker! Encourage your team to use threaded comments to say, "hey, can't we do such-and-such about this situation?"

16 replies

Userlevel 7
Awesome Seth!  And thank you for posting the detailed instructions.
Userlevel 6
Seth, dude, you such a rockstar.  Thanks for being awesome. 
Userlevel 1
Nice one Seth
Userlevel 6
Wow Seth ! Thanks for this amazing post with detailed instructions! 
Userlevel 7
Badge +1
Thanks Karl! If you'd told my 13-year-old self that I would one day be a bionic rockstar, my brain probably would have exploded.

So, I guess, maybe it's better that we waited.
Userlevel 7
Badge +1
Seth, this is quite possibly the best Community post on our site (and there are some great ones)! I can't thank you enough for posting this, as I used this documentation almost step by step for a customer today who wanted to implement something similar.
Userlevel 7
Badge +1
Spencer, I'm so thrilled to hear it, thank you for passing along the news! I always worry, when writing up something like this, that it ends up completely accurate but overwhelming and effectively unreadable. So, the fact it actually turned into real value for someone else means I did somethin' right!
Userlevel 7
We'll make sure this gets published on GS Go, too. Thanks for taking the time to write and share these instructions, Seth!
Userlevel 7
Badge +2
I really appreciate your skill here. You are a bionic rockstar!
Userlevel 6
Badge +1
Seth, this is simply awesome!!! Very easy to follow and extremely useful!!!! Thanks a ton for sharing this!

@Gainsight: any possibility on having the above "deliverables" canned into templates that could be downloaded? This seems something that everyone could use.
Userlevel 7
Badge +1
Thanks, Marcelo! So great that it comes across as easy to follow -- not the first adjective I always hear for Data Spaces, Bionic Queries, or Advanced Outreaches, let alone all of them in combo, but maybe we're co-Champions because fear doesn't slow us down even a little 😉
Userlevel 7
Badge +1
Woah, Seth! Just came across this post and it has blown my mind. Gainsight Product, can we think about bringing this functionality OOB?
Userlevel 3
@seth could you confirm what table would be used in part 3 if using Survey 2.0, is it the same?

Userlevel 7
Badge +1
Apologies for the very slow reply, Shannon! I'm going to see if I can track down that info, since I have far more experience with Surveys 1.0 than 2.0.

Userlevel 7
Badge +1
@shannon : Survey 2.0 is completely worked on MDA, which means that you don't need a dataspace for these objects to talk to each other. It happens via the lookup on the object.The information on where the survey 2.0 objects reside can be found here:

Specifically, you may want to look at 'NPS Survey Response', 'Survey User Answer' objects etc.

Userlevel 7
Badge +1

This is awesome! I’m thinking about additional ways of using this for admin notifications. Currently testing a model to notify me of GS Error Log entries. I can see so many use cases for this until Gainsight expands Sally notification capabilities. 


Thank you!