In Salesforce, using Surveys, we collect user data through a review or a feedback form. After setting up the survey, the next task is to send the surveys. In Salesforce, we can automate and send survey invitations using flow automation, specifically, a record trigger flow.
In this Salesforce tutorial, I will explain how to automate survey invitations using Lightning Flows.
Automate the Survey Invitation in Salesforce using Flows
In this automation, we will use the Salesforce Record-triggered flow to automate the process of sending the flow invitation.
For example, when a support case is closed, a survey invitation will be sent to the contact associated with that case.
To create the flow, navigate to the Lightning setup and follow the steps below.
- On the setup page of Salesforce Lightning, navigate to the Quick Find box and search for ‘Flows’, then select it.

- In the flow setup, click on the New Flow button. In the next window, select the option Start from Scratch. Then, in the flow options, select the “Record triggered flow” and click the “Create” button.
- Select the case object to configure the start of the trigger flow. Then, in the trigger conditions, select when the record is updated.

- In the section Entry Conditions, select When All Conditions are Met.
- In the entry conditions, select Field as Status, Operator as Equals, and Value as Close. These conditions will trigger when the status of a case record is updated to “closed.“

- Now, to add the survey invitation logic, we will add the action component to the flow and, in the actions, select the survey for which you want to set the automated invitation.

- In the field Survey subject, select the New Resource and create the new resource with the following details.
- Select the Resource Type as a Variable, and enter the API Name. After this, select the Data Type as Text and the Default Value as “{!$Record.Id}” that will appear as Triggering Case > Case ID.

- In the ‘Recipient type’ field, select the ‘Contact’ option.
- In the Recipient field, click on the New Resource, and for the new resource, select Variable. Enter the API Name and select the data type as Text.
- In the Default value, select contact id with the value {!$Record.Contact.Id} that will appear as Trigerring Case > Contact ID.

- Activate the checkboxes for the Unique link that doesn’t require authentication. In the field, Invitation expires in days select the number of days for the expiration of the survey invitation.

At last, save and activate the record-triggered flow.
Enable the Permissions for the Flow
To make the flow accessible, we need to enable the required permissions for the flow. To set permissions, navigate to the Setup page and follow the steps below.
- On the setup page, go to the Quick Find box and search, then select All Sites under Digital Experiences.

- Click on the Builder on the site.

- In the setup, click on the settings icon, then under the Guest User Profile, click on Customer Community Profile.

- Click on the Edit button and ensure the customer or the profile has Read access to the Survey object.
- After this, go to the survey settings and select the Experience Cloud site for the survey.

Ensure the Experience Cloud site is Active and published.
Test the flow
According to the flow trigger conditions, a survey will be sent to the case contact when the case status is updated to closed.
- Click on the App Launcher and navigate to the Cases object.

- In the case tab, select a Case record and update the case status as Closed according to the trigger logic.
- In this case, the associated contact is Jack, and I entered my email to test the flow.
- As we update the Case status to Closed, the contact should get a survey invitation through email.
- If the flow runs successfully, the contact will receive an email with a link to the Survey Invitation, as shown in the image below.

This way, we can automate the survey invitation in Salesforce using the flows.
Conclusion
In this Salesforce tutorial, we learned how to automate the survey invitation in Salesforce using the Flow. In the record trigger flow, we defined the trigger conditions and added email action to send the survey invitation to the user through email.
Ensure you have a valid Experience Cloud site ID with access to the survey. If the invitation is supposed to be sent to users outside the organization, then the site must require guest access to view and submit the survey from an unauthenticated site.
You may also like to read:
- Create Surveys Using Flows in Salesforce?
- Dynamically Add CC Recipient’s Address List to Salesforce Flow
- Get Current Record ID in Salesforce Flows
- Send Email with Flows in Salesforce?
- Transform Element in Salesforce Flow
I am Bijay Kumar, the founder of SalesforceFAQs.com. Having over 10 years of experience working in salesforce technologies for clients across the world (Canada, Australia, United States, United Kingdom, New Zealand, etc.). I am a certified salesforce administrator and expert with experience in developing salesforce applications and projects. My goal is to make it easy for people to learn and use salesforce technologies by providing simple and easy-to-understand solutions. Check out the complete profile on About us.