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/{!SurveyInvitation.Id}&surveyName=survey_demo&UUID={!SurveyInvitation.UUID}"> Click here to begin survey </a>

Jitendra Zaa

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

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

38 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.

    1. Hello ,

      I can not see Survey invitation and Survey object in org even after enabling survey . Can you help !

  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} (
    Name = {!formula_surveyName} (Survey for CaseCase-000000058)
    OptionsAllowGuestUserResponse = true
    OptionsCollectAnonymousResponse = true
    SurveyId = {!varSurveyId} (0Kd1i000000L747CAC)
    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

  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!

    1. Go to Setup -> All Communities -> Hover over the Active Community link which you are using for Survey. On the bottom above Task Bar of your computer you will see URL which will have “networkId=xxxxxxxxxxxxx” The 15 digits after networkId= is your Community ID

  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?

    1. Hi PK, did you find a solution for sending survey to contacts outside community? Could you please share with me ? Thank you!

    2. Hi PK, did you find a solution for sending survey to non-community users? (contact) It will really be appreciated if you can share the solution ! Thank you!

  9. Hi Jitendra, thank you so much for your post. It works well!

    I just wonder if we can create multiple unique survey invitations to multiple contact in one flow? Right now I use one flow to create one survey invitation for one contact and I need to create 10!


  10. Want to send a survey link for the guest user in salesforce once case is closed.Please suggest any app?Used Survey-Force ,but its requiring guest user login and password,but this should not happen.Guest user should be redirected to vf page.

    This can be done by:——> develop a vf page of survey information ,which is sent to customer email id when a corresponding case is closed .Also want to store the survey submitted by customer(guest user).

    Please provide the code of vf page for this requirement.

  11. Jitendra,

    Hi and thank you.

    There appears to be a known issue that has yet to be resolved regarding the emailed link for a Survey to a guest user. I just wanted to know if you’ve run into this issue or would be willing to discuss further.

    I’m able to send the link (embedded link) via email on a Closed Case to an external client Contact. However, when the button link is selected I get a 404 error code that indicates it’s looking for \aura component. I’ve searched my org and can find no such component even exists outside of the system generated (public folder) Customer Satisfaction survey.

    We also have an installed package called Survey and I’m wondering if there could be something in the managed package overriding our ability to create our own Surveys.

    Suggestions/guidance greatly apprecaited


      1. Hi ZerovizBoss,

        Have you found the solution for guest users taking the survey without login? Can you please help me on this..

  12. Hi Jitendra – We are planning to load around 300+ surveys from another system to salesforce. Is there a way to data load these in to Survey object? I am not able to find a way to insert/upsert on this Survey object except query.


  13. Jitendra,

    Okay, I’m having a new issue…I’ve followed your logic but I’m not able to see the sObject Variable for sObjSurveySubject. I’ve tried creating a Collection Variable, and making an assignment, but that’s not working either. Any suggestions?


  14. Hi,
    I have a requirement wherein we have to create cases based on the survey response we get. Is this possible?

  15. Hi,

    I have followed all the steps above, i need to have case number on email template so i used custom field and incorporated it on my email template. however i have been getting error below inspite my survey is active i als tried to create a new survey an incorporate it but still it is not working please help

    Error Occurred: This error occurred when the flow tried to create records: INVALID_FIELD_FOR_INSERT_UPDATE: Your survey hasn’t been activated yet. Activate your survey and try again.. You can look up ExceptionCode values in the SOAP API Developer Guide.

  16. Hi!
    I’m facing some issues. I configured everything like you showed, but I have problems using salesforce classic email template.
    I added {!SurveyInvitation.Host_Name__c} but always show it as null when email is sent. I cheked in Survey Invitation page layout and it has a value but it appears empty in the email.
    Anyone has experienced anything like this?

  17. Hi Jitendra,

    Thanks for this very helpful guide. I am curious to know though, would this work if I’m sending the survey to a non-community contact? Thanks!

  18. Hi Sir,

    I have a quick question regarding sending the surveys. Is it possible to send the surveys to a group of contacts through process builder.

    Any help would be muc appreciated.


  19. Hi, we are able to capture the responses in survey responses. but how to populate in Case object the survey response values like csat, nps… is there any code required for this.

    now in case related list having survey subject which contains all other information.

    1. Hi Raj

      I have the same doubt.
      How do we populate Survey results (aka responses) in the case objects.
      Our Agents needs to be able visualize the feedback we get for each case.

  20. Hello-I tried to create an outbound change set to migrate survey from sandbox to prod. I was able to locate the add the survey using flow definition. In prod, however, when validating inbound change set, I received following error: pageNamesInOrder (Variable) – A Survey required variable must be defined as both input and output. Any idea how to resolve? It doesn’t seem that I am able to access the survey flow to define variables. Thanks

  21. This is a really useful post, thanks! Do you know of a way to use flow/process builder to get the questions and answers someone has selected using a generic link and get them into an email when a response is received?

Leave a Reply

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