loader

Service Cloud · Surveys

Send a Salesforce Survey Automatically When a Case Closes

Asking for feedback right after a support case is resolved is one of the easiest ways to measure service quality. This guide sets up a Salesforce Survey that goes to the customer automatically when their case closes, with a unique link tied back to the case.

Updated for 2026: this now uses Flow, not Process Builder

Salesforce has retired Process Builder, so the older two-process approach is replaced here with one record-triggered flow. If you built this with Process Builder, migrate it to Flow before something breaks.

How it works

Record-triggered flow on Case Case closed with a contact Create survey invitation Save link on the case Email the customer Customer responds

The response is saved in Salesforce and linked to the case through the survey invitation.

Part 1

Prerequisites

  1. Enable Surveys. In Setup, search for Survey Settings and turn on Surveys.
  2. Enable Digital Experiences. Customers who don’t log in answer through an Experience Cloud site, so you need one. In Setup, go to Digital Experiences › Settings and enable it. See Enable Salesforce Communities.
  3. Create and activate your survey. Build it in the Surveys app and activate it. Note the survey’s record ID.
  4. Get the site’s Network ID. Go to Digital Experiences › All Sites, right-click your site’s URL and copy the link. The Network ID is the value starting with 0DB. Leave off any trailing &.

Part 2

Create the custom fields

ObjectFieldTypePurpose
CaseSurvey LinkURLHolds the unique survey link used in the email
Survey InvitationCaseLookup (Case)Connects each invitation and its response to the case

Part 3

Set up the email

Email template

Create a Classic or Lightning email template on the Case object in your brand’s tone. A simple version:

Subject: How did we do on case {!Case.CaseNumber}?

Hi {!Contact.FirstName},

Thanks for reaching out about case {!Case.CaseNumber}. Now that it’s resolved, we’d love to hear how it went. The survey takes about a minute:

{!Case.Survey_Link__c}

Thank you,
[Your name]

Email alert

  • Object: Case
  • Email template: the template you just created
  • Recipients: move Related Contact: Contact Name to Selected Recipients

Part 4

Build the record-triggered flow

Create a new Record-Triggered Flow with these settings and elements, in this order:

  1. Trigger: Case, when a record is created or updated, optimized for Actions and Related Records.
    Entry conditions: Status equals Closed AND ContactId is null = False.
    Run the flow: Only when a record is updated to meet the condition requirements, so it fires once per closure.
  2. Create Records: Survey Invitation. Set the field values:
    FieldValue
    NameCase number plus “Survey”, from a text formula
    Survey (SurveyId)Your survey’s record ID
    Community (CommunityId)Your site’s Network ID
    Allow Guest User ResponseTrue
    Participant (ParticipantId){!$Record.ContactId}
    Case (custom lookup){!$Record.Id}
    Store the new record’s ID in a variable.
  3. Get Records: Survey Invitation where Id equals the ID from the previous step. This gives you the generated InvitationLink and UUID.
  4. Update Records: update the triggering Case and set Survey_Link__c to the invitation’s InvitationLink.
  5. Action: Send Email Alert. Pick the email alert from Part 3 and pass {!$Record.Id} as the record ID.

Save and activate the flow.

Building the link yourself: if the InvitationLink field isn’t available in your org, build the URL with a formula from the invitation ID and UUID, using the link format from the survey’s Send screen with Don’t require authentication selected:

"https://your-site-domain/survey/runtimeApp.app?invitationId=" & {!Invitation.Id} & "&surveyName=your_survey_api_name&UUID=" & {!Invitation.UUID}

Part 5

Give guest users access

Customers answer as site guests, so the guest user needs access to the survey objects.

  1. In Setup, search for Digital Experiences and open All Sites.
  2. Open Builder for the site that hosts your surveys.
  3. Go to Settings › General and click the profile under Guest User Profile.
  4. Click Edit and grant these object permissions, then save.
ObjectPermission
SurveysRead
Survey InvitationsRead
Survey ResponsesRead, Create, Edit

Test it

  • Close a test case that has a contact with your own email address
  • Check that a Survey Invitation was created and linked to the case
  • Check that the Survey Link field on the case is filled in
  • Open the email and complete the survey in a private browser window
  • Confirm the response shows up in Salesforce against that invitation

Common questions

Why does the survey say the link is invalid or expired?

Usually the guest user is missing a permission, Allow Guest User Response isn’t set on the invitation, or the Network ID belongs to a different site than the one in the link.

Will reopening and closing a case send another survey?

Yes, each time the case moves to Closed. To prevent that, add an entry condition that the Survey Link field is blank.

Is there a way to do this without a custom flow?

Salesforce Feedback Management includes Survey Invitation Rules, which can send a survey when a record meets set criteria. Availability depends on your license, so check your org first. The flow approach works with the standard Surveys feature.

Want feedback built into your support process?

We set up Service Cloud surveys, CSAT reporting and the automation around them.

Book a free consultation