With the Actions & Recommendations Component, you can Create a To-Do List
Remove the need for your users to remember what they need to do in Salesforce. Using the Actions & Recommendations component in Lightning Experience, provide users with a to-do list on the record page.
(Note: The Actions & Recommendations component’s primary goal is to display flows, quick actions, and recommendations from your Next Best Action strategies.) An Actions & Recommendations deployment or Salesforce automation tools can be used to generate the to-do list (process or flow).
Addison Dogster works as the system administrator at Sprinkles, a company that sells cupcakes on the go. Devohne Mays, Head of Sales Operations, is having difficulty getting his staff to follow the processes for a cupcake order from creation to completion. His rock star employees are following the steps to the letter, but other employees are missing steps, resulting in inconsistent customer service.
Addison wants to eliminate the need for employees to remember what to do, so she discovered a Salesforce feature called Actions & Recommendations. While this component is primarily used for Einstein Next Best Action to display actions from a next best strategy, she thought she could use it to show the Sprinkles staff a to-do list. All they have to do is go down the list and perform the actions indicated in the component. From now on, each order is handled consistently.
RecordActionDemo
View image in full screen mode
Addison used Flow Builder to create a Record-Triggered Flow to automate the creation of the actions in the Actions & Recommendations component.
RecordActions should be created for the Cupcake Order-Flow.
Steps that have been highlighted:
While you can use Process Builder to create the actions that appear in the Actions & Recommendations component, this blog post will show the solution built using Flow Builder, which is the end state declarative automation tool.
- In the Actions & Recommendations component, create the quick actions, screen flows, or auto-launched flows you want to show as actions.
- Implement the above-shown record-triggered flow. It can be found in Lightning Experience under Process Automation | Flows. Select “New Flow.” Choose Record-Triggered Flow.
- Set the Start element to the following.
Activate the Flow When: A new or updated record is created
Flow the Flow: After saving the record, set the Object to:
Order of Cupcakes
Requirements for the Condition: All requirements have been met (AND)
Status c is the same as Submitted
When Should the Flow for Updated Records Be Run? Every time a record is updated and the condition requirements are met
RecordActions should be created for the Cupcake Order-Flow-Start.
- Include a New or Status Changed? Decision flow element. This would determine whether the record was created recently or if the status field had changed. We must determine whether the record is new (i.e. the previous record lacks an id) or whether the status has changed. We’re using the decision element because we can’t access the previous record in the start element.
Best practice tip: Include a description so that you and other/future administrators understand what this flow resource is used for.
This is how the flow resource would be set up.
Outcome: Yes
Conditions for executing the outcome: Any Condition is Satisfied (OR)!$Record Prior.Id In Null!$GlobalConstant.True
!$Record.Status c Has Been Modified!$GlobalConstant.True (Please note that this is only available in API Version 52 or later.)
(Use this condition instead of the second if you are in a Winter ’21 organization.) !$Record Status c Is Not Equivalent to!$Record Prior.Status c
If the condition requirements are met, the outcome should be executed.
RecordActions should be created for the Cupcake Order-Flow-Decision.
View image in full screen mode
The Yes Outcome path encompasses all of the flow elements listed below.
- Create a Log a Call RecordAction flow element in the Create Records flow. The Log a Call action will be added to the Actions & Recommendations component.
Best practice tip: Include a description so that you and other/future administrators understand what this flow resource is used for.
This is how the flow resource would be set up.
How many records should be made: one
How to Configure the Record Fields: Separate resources and literal values should be used.
QuickActionDefinition.Cupcake Order c.Log a Call Object: RecordAction ActionDefinition: QuickActionDefinition.Cupcake Order c.Log a Call
QuickAction is the type of action.
RecordId:!$Record.Id Order: 1
The API name of the quick action or flow that you want to appear in the component is specified in the ActionDefinition.
You can choose between QuickAction and FlowDefinition as an action type (aka Flow).
The display order in relation to the other actions is defined as order.
Create Cupcake Order-Flow-CreateRecords1 RecordActions
View image in full screen mode
- Create a Process Order Record Action flow element in the Create Records flow. The Process Order action will be added to the Actions & Recommendations component.
Best practice tip: Include a description so that you and other/future administrators understand what this flow resource is used for.
This is how the flow resource would be set up.
How many records should be made: one
How to Configure the Record Fields: Separate resources and literal values should be used.
QuickActionDefinition.Cupcake Order c.Process Order Object: RecordAction
QuickAction is the type of action.
Order: 2
!$Record.Id is the record ID.
Create Cupcake RecordActions. Order-Flow-CreateRecords2 View image in full screen mode
- Create a Complete Order Record Action flow element in the Create Records flow. The Complete Order action will be added to the Actions & Recommendations component.
Best practice tip: Include a description so that you and other/future administrators understand what this flow resource is used for.
This is how the flow resource would be set up.
How many records should be made: one
How to Configure the Record Fields: Separate resources and literal values should be used.
QuickActionDefinition.Cupcake Order c.Complete Order Object: RecordAction
QuickAction is the type of action.
Order: 3
!$Record.Id is the record ID.
Create Cupcake RecordActions. Order-Flow-CreateRecords3 View image in full screen mode
- Create a Send a Survey Record Action flow element in the Create Records flow. The Send a Survey action will be added to the Actions & Recommendations component.
Best practice tip: Include a description so that you and other/future administrators understand what this flow resource is used for.
This is how the flow resource would be set up.
How many records should be made: one
How to Configure the Record Fields: Separate resources and literal values should be used.
ActionDefinition: QuickActionDefinition.Cupcake Order c.Send a Survey ActionType: QuickAction
Order: 4
!$Record.Id is the record ID.
Create Cupcake RecordActions. Order-Flow-CreateRecords4 View image in full screen mode
- Create a Send an Email Record Action flow element in the Create Records flow. The Send Email action will be added to the Actions & Recommendations component.
Best practice tip: Include a description so that you and other/future administrators understand what this flow resource is used for.
This is how the flow resource would be set up.
How many records should be made: one
How to Configure the Record Fields: Separate resources and literal values should be used.
ActionDefinition: Send Email ActionType: Flow Object: RecordAction
Order: 5
!$Record.Id is the record ID.
Create Cupcake Order-Flow-CreateRecords5 RecordActions
View image in full screen mode
- Debug the flow by selecting a record with the status ‘Submitted’ and running the flow as if the record was Created. Debug the flow again with a record with a status of ‘Submitted,’ but this time specify that the flow should be run as if the record is Updated.
- After testing the flow with debug and confirming that it works as expected, save the flow with these properties. Start the flow.
Provide a description so that you and other/future admins know what this record-triggered flow is for.
RecordActions should be created for the Cupcake Order-Flow-Properties.
- Go to the Cupcake record detail page and select Edit Page from the wrench icon to open the Lightning record page in Lightning App Builder.
AppBuilder
- Locate and drag the Actions & Recommendations component onto the page. Save your changes.
AddActionsAndRecommendationsDemo
View image in full screen mode
You’re finished!
Don’t forget to test the rest of your configuration changes before deploying them to Production.
Make a new cupcake record (status = ‘Submitted’), then double-check that the 5 actions are created as expected.
Change the status of a cupcake record to ‘Submitted,’ and check that the 5 actions are created as expected.
Change the status of a cupcake record to something other than ‘Submitted,’ and check that no actions are created.
Notes/Tips for Deployment:
Flows, Quick Actions, and the Lightning Record page can be deployed to Production as part of a change set (or by using a tool like Metazoa’s Snapshot).
The flow is located in a change set under the Flow Definition component type.
Activate the flow after deployment because flows are deployed inactive in Production unless you have selected “Deploy processes and flows as active” on the Process Automation Settings screen. NOTE: As a result of this change, in order to successfully deploy a process or flow, your org’s Apex tests must cover at least 75% of the total number of active processes and active autolaunched flows in your org, or you can select 0%, which will run apex classes unrelated to your flow.