Last year’s Salesforce Spring ‘21 release provided several exciting new Flow features, including:
- Sending a Survey Invitation as an action in flows.
- Triggering flows when a record is updated.
- The standard related list for Survey Invitations and Responses became available on custom objects.
With these three features together, it’s possible to automatically send a survey invitation with Flow from any record, as long as you can link the invitation to the invitation recipient (User, Contact, or Lead). You can also view the results on the initial record and the recipient record! Here are some straightforward steps to follow when creating a Survey Invitation with Flow…
Step-by-Step Guide
Step 1:
Create the survey you want to send and activate it. This step assumes that you have a community hosting surveys, and that the guest user for the community has access to the Survey Invitation and Survey Response objects. When you use the Flow Send Survey Invitation action, you can only select active surveys.
Step 2:
Decide what field in the object will trigger the survey invitation. This example uses a custom object called Invoice. It sends the invitation when the Status field on the Invoice is set to Paid.
Step 3:
Create the flow. Select New Flow. Then select Record-Triggered Flow, as shown below:
Step 4:
Select Auto Layout (or Freeform).
Step 5:
Configure the trigger to start when the record is created or updated after the record is saved.
Step 6:
Choose Invoice as the object every time it is updated (no conditions).
Step 7:
Create two new resources, InvoiceId and ContactId. Both of these will be set from the triggering Invoice record.
Step 8:
Set the variables.
- SubjectId = Invoice__c.Id ($record*)
- ContactId = Invoice__c.Primary_Recipient__c (a look-up field to Contact).
*The Invoice record is actually a global record called $record. This is done automatically because Invoice was the triggering record.
Also note that the ‘prior’ Invoice record, the record before the update, is available.
Step 9:
Add an action. Select Surveys from the list on the left, and all active surveys will be available in the list.
Step 10:
Set the available variables in the selected action:
- Survey Subject is set to the variable InvoiceId.
- Recipient is selected as Contact and then set to the variable ContactId.
- Options are set according to personal preference.
Step 11:
Your flow is done! Save and Activate.
Survey Results
To see the survey results, add the Survey Invitations and Responses related list to both the Contact page layout and the target object page layout. The survey responses can be viewed as an action in the related list.
Summary
I hope this step-by-step guidance makes it easy for you to send Survey Invitations automatically using Salesforce Flow. You may also be interested in the following Flow resources:
- Everything You Need to Know About Flow Trigger Explorer | Salesforce Ben
- How to Structure Your Record-Triggered Flow Strategy | Salesforce Ben
- What I Wish I Knew About Record-Triggered Flow | Salesforce Ben
Comments: