Recipe to Push NPS Responses to Slack


Userlevel 7
Badge +6
  • Gainsight Employee: ACE
  • 548 replies

Note that there’s a now a much cleaner way to do this! My article below describes how to use email as the method to get data from Gainsight to Slack, but you can use the APIs instead.

Step 1. Create an External API Action that has the right fields to accept the data that you want to show in your Slack post: Step-by-step tutorial

Step 2. Set up your JO Program to use that Action, and populate it with data from the survey response: Call API Action Type in Programs

-------

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

  • Add the "Email" app to your Slack instance
  • Add a configuration called "Gainsight"
  • 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)
  • Customize its icon. I used the Gainsight logo
  • Grab the email address that Slack has created for you

Part 2: Populate the Slack email address onto every Account

  • Create a custom field on Customer (in Salesforce Setup > Create > Objects > Customer Info > Custom Fields > New). Here's my setup for that field: https://cl.ly/1b410W0y3X40
  • I have a nightly Rule that updates every Account. I added an Action that populates that field when it's null. Setup shown here: https://cl.ly/3J2y201U033Z

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:

  • 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)
  • FromSurvey User Answer > Question: Title (this is the text of the question), Question Number (so you can filter for certain questions)
  • From Survey User Answer > Survey Master: Title (this is the name of the survey)
  • 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)
  • From Survey User Answer > Participant > Contact: Email, Full Name
  • 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:

  • 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: https://cl.ly/2a24010O0X3m
  • 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: https://cl.ly/1x1y0W1m2p2m I have two Tasks like this, each one filtering for a different question.
  • 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: https://cl.ly/3m163S2k2523 (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.)
  • Merge Task: Combine your NPS responses with the text from an open-ended question. My setup: https://cl.ly/0l0O0l2R2x13
  • Merge Task: Combine the results of the first merge with the answers to the other open-ended question. My setup: https://cl.ly/1i3z3C0i273u
  • Merge Task: Combine the results of the previous merge with that "FullName @ AccountName" info. My setup: https://cl.ly/0p1V2b0h3w1z
  • Don't forget to Schedule it! My setup: https://cl.ly/1K0W2D0k2O2u

Part 5: Configure the rest of the Sources setup

Back in the "Sources" area:

  • You want the same participant to be able to enter the Advanced Outreach an unlimited amount of times. My setup: https://cl.ly/1G3P3E3g3v32
  • Some of the standard fields can be useful, but you'll also create custom fields for question responses and so on. My setup: https://cl.ly/3p0N020e2i3Z

Part 6: Set up your email template

  • 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: https://cl.ly/3x0j2T1z2x19 If someone doesn't submit any comments in my setup, their response comes through like this:

     

  • 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: https://cl.ly/0O14421y3l25

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

Badge +3
Awesome Seth!  And thank you for posting the detailed instructions.
Badge +3
Seth, dude, you such a rockstar.  Thanks for being awesome. 
Nice one Seth
Wow Seth ! Thanks for this amazing post with detailed instructions! 
Userlevel 7
Badge +6
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 +2
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 +6
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
Badge +3
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 +1
I really appreciate your skill here. You are a bionic rockstar!
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 +6
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 6
Badge +4
Woah, Seth! Just came across this post and it has blown my mind. Gainsight Product, can we think about bringing this functionality OOB?
Badge +1
@seth could you confirm what table would be used in part 3 if using Survey 2.0, is it the same?


Userlevel 7
Badge +6
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 6
Badge +4
@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:



https://support.gainsight.com/Administration_and_Permissions/General_Administration/Gainsight_Object_Glossary



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


Userlevel 7
Badge +11

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!

Reply