Automate Your Survey Invitations
Learning Objectives
After completing this unit, you’ll be able to:
- Create a flow on the Opportunity object.
- Automate a survey invitation.
Make a Copy
Ursa Major Solar is growing at an unbelievable pace, all thanks to its sales reps. And it’s important to take feedback from sales reps about opportunities that are won or lost. Gabriela wants to send the customer satisfaction survey to sales reps every time an opportunity is lost or won.
Maria tells her that they can create a Salesforce Flow to automate the survey invitations. But Maria must first make a copy of the customer satisfaction survey and activate it for the flow. Here’s how she does that.
- Click to open the App Launcher, enter
Surveys
in the search box, and select Surveys.
- Click the dropdown arrow on the right for the Customer Satisfaction survey.
- Select Open Latest Version.
- On the Survey Builder page, click and select Make a Copy.
- Name the copy:
CSAT 01
- Click Make a Copy.
- Click and select Default Settings.
- Click Email Templates and select Embed_a_Survey_Link.
- Click Save.
- Click Activate.
If you don’t see the option to select Embed_a_Survey_Link in Email Templates, do the following.
- From the App Launcher, find and select Email Templates.
- Click the dropdown menu next to Embed_a_Survey_Link and select Edit.
- Click Save.
Create a Flow on the Opportunity Object
Having set up the survey, Maria creates a flow on the Opportunity object.
- Click and select Setup.
- Enter
Flows
in the Quick Find box, then select Flows.
- Click New Flow.
- Make sure Start from Scratch is selected, and click Next.
- Select Record-Triggered Flow and click Create.
- Select Opportunity as the Object.
- In the Configure Trigger section, select A record is updated.
- For Entry Conditions, select Any Condition is Met (OR) and define the conditions:
- Condition 1
- Field: StageName
- Operator: Equals
- Value: Closed Won
- Field: StageName
- Condition 2
- Field: StageName
- Operator: Equals
- Value: Closed Lost
- Field: StageName
- Condition 1
- Select Only when a record is updated to meet the condition requirements.
- In the section Optimize the Flow for, select Actions and Related Records.
Add New Resources
Next, she creates two resources that she will use to set up the flow.
- Click and select New Resource.
- Select Variable as the Resource Type.
- Enter
Context
as the API Name.
- Select Text as the Data Type.
- In Default Value, select $Record then select Id. The field should change to {!$Record.Id}.
- Click Done.
- Click New Resource.
- Select Variable as the Resource Type.
- Enter
Participant
as the API Name.
- Select Text as the Data Type.
- In Default Value, select $Record, then select Owner (the one with a > at the end of the line), then select Id. The field should change to {!$Record.Owner.Id}.
- Click Done.
Add an Action
The last step is to add an action that triggers a survey invitation once an opportunity is closed. Here’s what Maria does.
- On the flow canvas, on the path after the Start element, hover over and click . Select Action.
- In the Search… field, enter
csat
.
- Select the csat_01 action.
- In the Label field, enter
Send Survey Invitation to Sales Reps
. The API Name is automatically set to Send_Survey_Invitation_to_Sales_Reps.
- In the Survey Subject field, select Context.
- For Recipient Type, select User in Your Org.
- For Recipient, select Participant.
- Select Unique link.
- Save the flow. In the Flow Label field, enter
Survey Invitation on Opportunity Closure
. The API Name is automatically set to Survey_Invitation_on_Opportunity_Closure.
- Click Save.
- Click Activate.
Create an Opportunity
To test the flow, Maria creates an opportunity and sets its stage to Closed Won.
- Click to open the App Launcher.
- Enter
Opportunities
in the search box, and select Opportunities.
- Click New.
- For Opportunity Name, enter
Test Opportunity
.
- For Close Date, select the current date.
- For Stage, select Closed Won.
After the opportunity is closed, an email invitation for the CSAT 01 survey is sent to the sales rep. The invitation and response records are also available in the Survey Invitations and Responses list on the Related tab of the opportunity record. In the next unit, we’ll find out how to analyze survey responses.
Resources
- Trailhead: Flow Basics
- Trailhead: Automated Survey Invitations with Flows
- Salesforce Help: Send Survey Invitations Using Flows
- Salesforce Help: Flow