Admins

How to Use Salesforce Flow to Send Surveys

By David Claiborne

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:

The Author

David Claiborne

David is an independent technology consultant, focusing solely on salesforce.com since 2004. He started the Salesforce Surveys group on Trailblazer in 2018 when Surveys was released.

Comments:

    Nahul
    October 07, 2022 1:44 pm
    Hi I have error on community when using guest user "Survey Subject is not supported" what to do?
    Jordan
    June 12, 2024 9:23 pm
    How do you determine who the sender is via the send survey action?
    Rob
    August 30, 2024 12:00 am
    you hove probably long since found the answer but it will use whatever your Survey Default Settings are for the current active version of the survey - that's where you set the sender, and the e-mail template.

Leave a Reply