Send Survey On Case Closure And Relate The Response To Case and Contact

Author: Rishabh Dubey


Prerequisites: Survey and Community should be enabled for the organization.

Enable Surveys –
Enable Community –

Create all custom fields required for automation.

Create URL field on Case object for -” Survey Link.”
Create a Lookup to Case on Survey Invitation Objects.

2. Create an email template and make it available for use. Edit the text to suit your needs.

Sample Email body-

Dear {!Contact.FirstName},

Thank you for submitting case number {!Case.CaseNumber}, now that the issue is closed, please consider completing this survey.


Thank you,



3. Create an Email Alert. Object: Select Case Email Template: Select the email template you created above. For Selected Recipients: Move “Related Contact: Contact Name” to the right. Save.



4. Create a new Process Builder (Setup/Process Builder/New) to automate sending the survey upon Case closed.
Choose Case as the object and select “when a record is created or edited.”
b. Define Criteria: Give it a name/ Select “Conditions are met.” In Set Conditions, you need:

Conditions select “All of the conditions are met (AND).”

Do you want to execute the actions only when specified changes are made to the Record? = True



5. Next, for Immediate Actions, we need to Create a Survey Invitation Record. You will need the following Set Field Values shown in the picture below.



To get the survey ID open the survey record in salesforce and copy the 18 digit ID from the URL.



Network ID: Get Network ID by going to Digital Experience/All Sites and right-click on the Community URL you selected when you enabled surveys, “Copy Link Address,” and then paste this link in a document and grab the ID. Then grab the ID highlighted and leave off the & at the end.

6. Next, in the Immediate Actions, add Email Alerts, type the name of the Email Alert you created above.
7. You can now Save and Activate this Process.
8. Now, we need to create a second Process Builder.

a. For your Object, choose Survey Invitation. Start: only when a record is created
b. For Criteria, choose “No criteria-just execute the actions!”

It will look like this: [SurveyInvitation] Case. c. Immediate Actions — choose Update Records, and for the Record, choose Case. Select “No criteria-just update the records!” For setting the values, in Field: select Survey URL, Type: Formula. Now the Value, click on the Value box so that it expands to allow you to create your formula.

9. Getting the “Value,” go back into your latest survey version and click Send so you will see the Get Survey Link window.
Click “Don’t require authentication” and Copy Link.



Now paste that URL in a document we will have to replace the hardcoded Ids in the link with [SurveyInvitation].Id & [SurveyInvitation].UUID

b. Change the link to the below format. Make sure you have included the open and close ”

+[SurveyInvitation].Id +

10. Paste this new formula URL you have created into the box and click “Use this formula.”



11. Save and Activate this Process.
12. Make sure your Guest User in the Community has CRUD permissions.
a. Enter Digital Experience in the Quick Find box, then select All Sites.
b. Open the Community Builder, which is selected as the default community for creating public survey invitations.
c. From Community Builder, click the Settings icon and select General.
d. Click the profile name under Guest User Profile.
e. Click Edit.
f. Standard Object Permissions section, add the following permissions:
Object: Survey
Permission: Read
Object: Survey Invitations
Permission: Read
Object: Survey Responses
Permission: Read, Create, AND Edit
g. Save.

We use cookies on this site to enhance your user experience. For a complete overview of how we use cookies, please see our privacy policy.