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

11 thoughts 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.

  2. Thanks Jitendra. But I’m not able to see Survey Invitations under Contacts for Anonymous Responses. Can you please help me with that.

  3. Good afternoon from Greece

    First of all I would like to thank you for sharing all this knowledge with us and for expanding our horizons.
    The reason I am contacting you is because I have encountered the following error:

    By reading the Error Occurred During Flow email I can understand that the fault is with the Create Survey Invitation Record element

    RECORD CREATE: Create_Survey_Invitation_Record
    Create one SurveyInvitation record where:
    CommunityId = {!varCommunityId} (0DB1i000000KzG0GAK)
    Email__c = {!varContactEmail} (bithyzis@gmail.com)
    Name = {!formula_surveyName} (Survey for CaseCase-000000058)
    OptionsAllowGuestUserResponse = true
    OptionsCollectAnonymousResponse = true
    SurveyId = {!varSurveyId} (0Kd1i000000L747CAC)
    Result
    Failed to create record.

    From reading the Flow fault email:
    This error occurred when the flow tried to create records: INACTIVE_OWNER_OR_USER: operation performed with inactive user [0051i000001VGaX]. You can look up ExceptionCode values in the SOAP API Developer Guide.

    the error is caused by Inactive_owner_or_user which currently blew my mind.

    Any assistance will be greatly appreciated.

    With regards
    Dimitrios

  4. At the end of Step 1, you mention:

    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.

    I was wondering where to create that field for Survey Invitation? I don’t see that object in Setup in my org.

  5. Hi at the end of Step 1, you mention that we have to create an email field on Survey Invitation object, but I’m seeing the survey invitation object in my org. Can you please elaborate where to create that field?

  6. Hi Jitendra,

    Works perfectly for me. Trying to implement it now for multi-language community, so if a field on the contact = FR, it should send the french translation of the survey. Any tips or tricks on where to implement this part? Been trying different options but it doesn’t seem to work.

    Thank you!

  7. Hello,

    I’m can’t see Survey on app menu so i am trying to add Manage Survey to permission set to a system administrator but it gives me an error that says the user license doesn’t allow the permission.

    What should i do?

  8. Can we send to contacts who are not community users and still track them with survey invitations?
    On survey invitation I am only seeing the invitation link for community users. How can we automate to send surveys to case contacts who are not community users and track their responses and roll up to the case (anonymously)
    Also, I am not able to view survey subject to add as related list to case or opportunity, any idea?

Leave a Reply

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