Give Your Users a To-Do List with Actions & Recommendations Component : jenwlee

Give Your Users a To-Do List with Actions & Recommendations Component
by: jenwlee
blow post content copied from  Jenwlee's Salesforce Blog
click here to view original post


ToDoList1

Eliminate requiring your users to remember things they need to do in Salesforce. Drive consistency to users with a to-do list on the record page using the Actions & Recommendations component in Lightning Experience.

(Note: The main intent of the Actions & Recommendations component is to show flows, quick actions, and recommendations from your Next Best Action strategies.) The to-do list can be generated by using an Actions & Recommendations deployment or Salesforce automation tools (process or flow).

Business Use Case:  Addison Dogster is the system administrator at Sprinkles, a company that sells cupcakes on the go. Devohne Mays, Head of Sales Operations, is struggling with his staff to consistency follow the processes for a cupcake order from creation to completion. His rock star employees are following the steps to a T but other employees are forgetting certain steps, leading to inconsistent customer service.

Solution: Addison wants to remove the need for employees to remember what to do and learned about a Salesforce feature called Actions & Recommendations. While this component is mainly used for Einstein Next Best Action to display actions from a next best strategy, she thought she can use this component to show a to-do list to the Sprinkles staff. All they need to do is go down the list and take the actions shown in the component. Each order is handled consistently from now on.

RecordActionDemo

View image full screen

Addison built a Record-Triggered Flow using Flow Builder to automate the creation of the actions in the Actions & Recommendations component.

Create RecordActions for the Cupcake Order-Flow

Highlighted Steps: 

Note: While you can create the actions that show up in the Actions & Recommendations component using process builder, this blog post will show the solution built using Flow Builder, which is the end state declarative automation tool.

1. Create the quick actions, screen flows or auto-launched flows you wish to show as actions in the Actions & Recommendations component.

2. Create the record-triggered flow shown above. In Lightning Experience, it is found under Process Automation | Flows. Click on “New Flow.” Select Record-Triggered Flow

A. Configure the Start element to the below.

  • Trigger the Flow When: A record is created or updated
  • Run the Flow: After the record is saved
  • Configure the Object to:
    • Object: Cupcake Order
    • Condition Requirements: All Conditions Are Met (AND)
      • Status__c Equals Submitted
    • When to Run the Flow for Updated Records: Every time a record is updated and meets the condition requirements

Create RecordActions for the Cupcake Order-Flow-Start

 
B. Add a Decision flow element called New or Status Changed?. This would determine whether the record is new or the status field has changed. We need to determine whether the record is new (i.e. prior record does not have an id) or whether the status has changed. We are using the decision element since in the start element, we are not able to access the prior record.
 
Best practice tip: Provide a description so you and other/future admins know what this flow resource is used for.
 
This is how that flow resource would be configured.
  • Outcome: Yes
    • Condition Requirements to Execute Outcome: Any Condition is Met (OR)
      • {!$Record__Prior.Id} In Null {!$GlobalConstant.True}
      • {!$Record.Status__c} Is Changed {!$GlobalConstant.True} (Note: This is available in API Version 52 or later)
      • (If you are in a Winter ’21 org, use this condition instead of the second one) {!$Record__Status__c} Does Not Equal {!$Record__Prior.Status__c}
  • When to Execute Outcome: If the condition requirements are met
 

All the flow elements below fall under the Yes Outcome path.

C. Add a Create Records flow element called Create a Log a Call RecordAction. This will create the Log a Call action in the Actions & Recommendations component. 

Best practice tip: Provide a description so you and other/future admins know what this flow resource is used for.
 
This is how that flow resource would be configured.
  • How Many Records to Create: One
  • How to Set the Record Fields: Use separate resources, and literal values
  • Object: RecordAction
  • ActionDefinition: QuickActionDefinition.Cupcake_Order__c.Log_a_Call
  • ActionType: QuickAction
  • Order: 1
  • RecordId: {!$Record.Id}

The ActionDefinition is the API name of the quick action or flow you want to appear in the component.

Action Type: You can select between a QuickAction or FlowDefinition (aka Flow).

Order is the display order relative to the other actions.

Create RecordActions for the Cupcake Order-Flow-CreateRecords1View image full screen

D. Add a Create Records flow element called Create a Process Order Record Action. This will create the Process Order action in the Actions & Recommendations component. 

Best practice tip: Provide a description so you and other/future admins know what this flow resource is used for.
 
This is how that flow resource would be configured.
  • How Many Records to Create: One
  • How to Set the Record Fields: Use separate resources, and literal values
  • Object: RecordAction
  • ActionDefinition: QuickActionDefinition.Cupcake_Order__c.Process_Order
  • ActionType: QuickAction
  • Order: 2
  • RecordId: {!$Record.Id}

Create RecordActions for the Cupcake Order-Flow-CreateRecords2View image full screen

E. Add a Create Records flow element called Create a Complete Order Record Action. This will create the Complete Order action in the Actions & Recommendations component. 

Best practice tip: Provide a description so you and other/future admins know what this flow resource is used for.
 
This is how that flow resource would be configured.
  • How Many Records to Create: One
  • How to Set the Record Fields: Use separate resources, and literal values
  • Object: RecordAction
  • ActionDefinition: QuickActionDefinition.Cupcake_Order__c.Complete_Order
  • ActionType: QuickAction
  • Order: 3
  • RecordId: {!$Record.Id}

Create RecordActions for the Cupcake Order-Flow-CreateRecords3View image full screen

F. Add a Create Records flow element called Create a Send a Survey Record Action. This will create the Send a Survey action in the Actions & Recommendations component. 

Best practice tip: Provide a description so you and other/future admins know what this flow resource is used for.
 
This is how that flow resource would be configured.
  • How Many Records to Create: One
  • How to Set the Record Fields: Use separate resources, and literal values
  • Object: RecordAction
  • ActionDefinition: QuickActionDefinition.Cupcake_Order__c.Send_a_Survey
  • ActionType: QuickAction
  • Order: 4
  • RecordId: {!$Record.Id}

Create RecordActions for the Cupcake Order-Flow-CreateRecords4View image full screen

G. Add a Create Records flow element called Create a Send a Email Record Action. This will create the Send Email action in the Actions & Recommendations component. 

Best practice tip: Provide a description so you and other/future admins know what this flow resource is used for.
 
This is how that flow resource would be configured.
  • How Many Records to Create: One
  • How to Set the Record Fields: Use separate resources, and literal values
  • Object: RecordAction
  • ActionDefinition: Send_Email
  • ActionType: Flow
  • Order: 5
  • RecordId: {!$Record.Id}

Create RecordActions for the Cupcake Order-Flow-CreateRecords5View image full screen

H. Debug the flow by selecting a record with a status = ‘Submitted’ and specify to the run flow as if the record is Created. Then debug the flow again using a record with a status = ‘Submitted’ but this time specify to run the flow as if the record is Updated

I. Once you tested the flow using debug and it works as expected, then save the flow with these properties. Activate the flow.

Best practice tip: Provide a description so you and other/future admins know what this record-triggered flow is for.

Create RecordActions for the Cupcake Order-Flow-Properties

3. Navigate to the Cupcake record detail page and click the wrench icon and selecting Edit Page to open the Lightning record page in Lightning App Builder

AppBuilder

4. Locate the Actions & Recommendations component and drag it onto the page. Save the changes.

AddActionsAndRecommendationsDemoView image full screen 

You’re done! 

Now, before you deploy the changes to Production, don’t forget to test the rest of your configuration changes.

  1. Create a new cupcake record (status = ‘Submitted’), verify the 5 actions are created, as expected.
  2. Update a cupcake record to status = ‘Submitted,’ verify the 5 actions are created, as expected.
  3. Update a cupcake record to a status that is not ‘Submitted,’ verify the actions are not created.

Deployment Notes/Tips:

  • Flows, Quick Actions and Lightning Record page can be deployed to Production in a change set (or can be deployed using a tool such as Metazoa’s Snapshot).
  • You will find the flow in a change set under the Flow Definition component type.
  • Activate the flow post deployment as flows deploy inactive in Production, unless you have opted in on the Process Automation Settings screen, to “Deploy processes and flows as active.” NOTE: With 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 the apex classes not related to your flow.

June 02, 2021 at 05:30PM
Click here for more details...

=============================
The original post is available in Jenwlee's Salesforce Blog by jenwlee
this post has been published as it is through automation. Automation script brings all the top bloggers post under a single umbrella.
The purpose of this blog, Follow the top Salesforce bloggers and collect all blogs in a single place through automation.
============================