Send Salesforce Survey Without Code

Use Flow & Process builder to send customer satisfaction survey on case close

Send Salesforce Survey using Flow and Process Builder

Salesforce Survey is available in Health Cloud & Financial Service Cloud otherwise its paid. Community Cloud is also required to use Survey.  If you need to practice Survey, create a 30 day trial org from this URL (mentioned in this trailhead module). One Survey can be created and used in Enterprise and Unlimited edition, so if you need only one survey then its free. In my case, I had to send same question to every customer on Case close , so it was free.

Prerequisite to use Salesforce Survey

Step 1 – Enable & create Community. Once community setup is done, we would need to activate it. Community can be created by any template. It can be blank as well, if it’s being created only for survey.

Step 2 – Enable Salesforce survey by navigating to Admin setup. You would need to select Community, which would be used by Survey to compute public unique link.

Salesforce - Enable Survey
Salesforce – Enable Survey

Step 3 –  Create and assign permission set, giving access to Manage Survey and CRED permission on Survey objects. This step is needed only if you are not able to see Survey in App menu.

Before moving ahead, we need to understand Survey Data Model. I’ve created below data model for this blog post to explain various objects involved.

Salesforce Survey Data Model
Salesforce Survey Data Model

Survey would be created by Admin. If we want this survey to be used by any customer, then need to create Survey Invitation and send link to customer. There are many ways to send survey but I would explain the technique that worked for me.

Step 1 – Create Survey

Navigate to App menu and search for Survey. Creating a new Survey in Salesforce is smoother than driving Tesla Model 3, just follow screen instructions.

Every Survey would have below three options for Admin

  1. View / Create Survey
  2. Send (Send Survey to internal or external user)
  3. Analyze (Survey Report)

Below are some screenshots of my demo Survey for this blog post (click to zoom-in image) :

Salesforce Survey Demo Screen 1
Salesforce Survey Demo Screen 1
Salesforce Survey Demo Screen 2
Salesforce Survey Demo Screen 2

Survey must need to have minimum 3 pages – Welcome Page, questions page & Thank you Page. Each page, at the time of writing this article contains below question types :

  • Date
  • Multiple Choice
  • Picklist
  • Radio
  • Rating
Salesforce Survey Question Types
Salesforce Survey Question Types

Once Survey setup is completed, we would need to activate it. Now let’s talk about what are the different pieces we would need and how they all can be glued together.

Below image tries to simplify, what we would be doing in rest of the blog post:

How to send Survey on Case Close in Salesforce
How to send Survey on Case Close in Salesforce

Before moving on next step, we would need to create a custom field of type Email on Survey Invitation object. This field would be used to store contact’s email address and send email alert.

Step 2 – Create Flow

Below image shows, how the final flow would look like. If you have worked on flow, you might be able to pick it up without even going through rest of post.

Flow to Send Survey in Salesforce
Flow to Send Survey in Salesforce

We would need to create below variables in flow

  • CaseId (Text, Input and Output)
  • caseNumber (Text, private)
  • communityId (Text, private)
  • contactEmail (Text, private)
  • contactId (Text, private)
  • surveyId (Text, private)
  • surveyInvitationId (Text, private)

sObject Variable

  • sObjSurveySubject (private, object type – SurveySubject)

Formula Variable

  • formula_surveyName (Text, formula – ‘Survey for Case ‘+{!caseNumber})

Let’s start with creating component on Flow Canvas

Component 1 – Case Record Lookup

Salesforce Flow - LookupCase
Salesforce Flow – LookupCase

Component 2 – Contact Record Lookup

Salesforce Flow - Contact Lookup
Salesforce Flow – Contact Lookup

Component 3 – Community Record Lookup

We would need Id of Community, so instead of hardcoding, we are going to query Network object to get needed Community Id

Salesforce Flow - Community Lookup
Salesforce Flow – Community Lookup

Component 4 – Survey Record Lookup

Salesforce Flow - Survey Lookup
Salesforce Flow – Survey Lookup

Component 5 – Create Survey Invitation Record

Create Survey Invitation Record
Create Survey Invitation Record

Component 5 – Assignment for SurveySubject

Salesforce Flow - Assignment for SurveySubject
Salesforce Flow – Assignment for SurveySubject

Component 6 – Create Survey Subject

Salesforce Flow - Create Survey Subject
Salesforce Flow – Create Survey Subject

Step 3 – Create Email Template and Email Alert

For sake of simplicity, we would create HTML email template without letterhead.  Email Template would be created for object Survey Invitation, other than Email__c field, I have also created Host_Name__c field of type formula (Text). We would need this field to compute survey link.

Host_Name__c =LEFT($Api.Partner_Server_URL_430, FIND( '/services', $Api.Partner_Server_URL_430))

Below is the content of Email template we would be using

How was your interaction with service agent.

Please take 2 mins to answer few questions in survey.

<a href="{!SurveyInvitation.Host_Name__c}survey/runtimeApp.app?invitationId={!SurveyInvitation.Id}&surveyName=survey_demo&UUID={!SurveyInvitation.UUID}"> Click here to begin survey </a>


~Cheers,
Jitendra Zaa

You might already have figure out the format of Survey Invitation Link from above email template, which looks like below

https://jit30trial.force.com/survey/runtimeApp.app?invitationId=0Kib4000000DKMG&surveyName=survey_demo&UUID=982900a2-ce21-4c44-95fa-4763b3bfe24e

It’s time to create email alert using above email template

Salesforce Email Alert for Survey
Salesforce Email Alert for Survey

Step 4 – Create Process builder

We would need two process builder to complete this setup :

Process builder 1 – Create Survey Invitation using Flow created in step 2. We would need to pass case Id to flow as shown in below image

Launch Flow from Process Builder
Launch Flow from Process Builder

Process builder 2 – Send email alert whenever Survey Invitation created

Send Email alert using Process Builder
Send Email alert using Process Builder

How to Test 

  • Create a case with contact having valid email address
  • Mark Case status closed – it should trigger Process builder to invoke Flow
  • Contact’s email address should receive an email, clicking on link should take user to survey page
Test Salesforce Survey
Test Salesforce Survey

Note : At time of writing this blog post, I came across this known issue, if you are impacted, let Salesforce know by clicking on This Issue affects me button.

Related posts

One thought on “Send Salesforce Survey Without Code”

  1. Thank you Jitendra. I have implemented and its working like a charm. Got some of the issue but fixed them.

    Thank you again.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.