Dynamic Actions – Taking User Experience to the Next Level in Lightning Experience, indeed!!

Dynamic Actions – Taking User Experience to the Next Level in Lightning Experience, indeed!!

Last Updated on January 21, 2021 by Rakesh Gupta

One of the key features I like from the Winter’21 release is the Dynamic Actions for custom objects. Since the release, it is generally available (GA) for desktop and is Beta for mobile. Furthermore, now, the actions are also supported for standard objects (Account, Case, Contact, Lead, and Opportunity) – please note that this is in Beta for desktop. 

The rule of thumb that has served me well, and that I always share with people who reach out to me for suggestions and recommendations, is that one should start solving a problem by first understanding the problem’s root cause before taking a deep-dive into devising a solution. As a result, before I show you how to use Dynamic actionslet us spend a few minutes to understand what Salesforce is trying to solve by introducing Dynamic actions?

In this article, we will discuss the following

  1. What are Quick Actions? 
    1. Display Action in Lightning Experience using Highlight Panel
      1. Business Use case I 
        1. A solution for the above use case 
      2. Business Use Case II 
        1. Solution I – Implement a complicated solution 
        2. Solution II – Impact on the user experience      
  2. What are Dynamic Actions? 
    1. A step-by-step guide to implementing it:
      1. Enable Dynamic Actions
      2. Adding an Action
      3. Adding a condition to show Action based on record field 
      4. Adding a condition to show Action based on a user’s profile 
    2. Benefits of Dynamic Actions

What are Quick Actions? 

Actions allow users to perform certain activities very quickly – such as create records, update records, send an Email, log calls, call a Lightning component, execute Lightning Flow, and call a Visualforce page. With custom actions, users save precious time by getting quick access to important information. It also has the capability to pre-populate the data from the record. 

There are two types of actions available to users: object-specific and global. 

  • Object-Specific actions: These actions have automatic relationships to other records. The actions let users quickly create or update records, send an Email, log calls, call Lightning components, execute Lightning Flow, and call a Visualforce page in the context of a particular object. A few examples of object-specific actions include the following:
    • Creating a custom action on the Lead object to update the Status to qualified.
  • Global actions: A System Administrator can create global actions in Setup. Then, s/he can put global actions anywhere on an object that supports actions. Using global actions, users can log calls, create records, send an email, call a Visualforce page, execute a Lightning component, and call Custom Canvas, all without leaving the page.

Display Action in Lightning Experience using Highlight Panel 

Once you create quick actions (object-specific or global), you can assign actions in the record detail page (Classic page layout) or, Salesforce Mobile and Lightning Experience Actions section. 

In the Lightning Experience, actions appear for users in the highlight panel.

Business Use case I

Sergio Armendariz is an App Developer at Gurukul on Cloud (GoC). He received the following requirement – Add an object-specific action Clone with Related to the Opportunity page layout so that it will appear on the highlight panel in the Lightning Experience.

A solution for the above business requirement

  1. Click Setup.
  2. In the User Interface, clicks on Object Manager.
  3. Navigate to Opportunity | Page Layouts | Opportunity Layout and click on the Edit link to edit the page layout. 
  4. Click on the Mobile & Lightning Actions 
  5. Drag the Clone with Related action into the Salesforce Mobile and Lightning Experience Actions section and place the action where you want it to appear.
  6. Click Save.
  7. The next step is to add Highlights Panel on Lightning Record Page for Opportunity.
  8. It’s time to see how it looks on the Opportunity record page:   

Business Use case II

Sergio was happy to learn something new today. He recently graduated from UC Berkeley and started his new job at Gurukul on Cloud (GoC). On the first day, his manager came to greet him and requested the following! – to make sure that the ’Clone with Related’ action – on the Opportunity page layout – is only visible when the Stage is ’Closed Won’ and only to users with System Administrator or Sales Manager profiles. 

Solution I – Implement a complicated solution

Sergio was stumped with the request. So, he immediately reached out to his Solution Consultant, Jason Derulo. Jason started explaining the different approaches Sergio can take to solve the above business use case.  

One of the approaches suggested by Jason was to create one Record Type and a Page Layout and assign the page layout to the Record Type based on profiles. Then, create a Lightning Flow – Before Save on Opportunity to update the record type of the Opportunity record once it is marked as Closed. 

As you notice, the above solution introduces a few different elements like Record type, Page layout, and a Flow, which unnecessarily complicates Salesforce org to solve a simple use case. Sergio wondered if there was a simpler solution!

Solution II – Impact on the user experience 

Jason’s second approach is to create one Page Layout and assign the Page Layout to Sales Manager and System Administrator profiles. This means that users with both profiles will always see Clone with Related quick action.  

In Salesforce, you can assign Page Layouts to Profiles by following the steps in the screenshot below: 


Unfortunately, however, using this approach impacts the user experience. This is because, not all end-users may be technical savvy; and, therefore, they may end up, advertently or inadvertently, clicking on buttons that are available on the Page Layout. What I learned – after working with end-users in the last few years – is that the best user experience is one where the right data is displayed to the right user at the right time.

After brainstorming heavily, Sergio and Jason left the office and went to a nearby Panda Express for lunch. While waiting in line – to order food – Jason called his Solution Architect Rakesh Gupta to seek his advice to solve Sergio’s use case without introducing new customization like Record type, Page Layout, automation, etc.

Rakesh requested Jason and Sergio to quickly jump on a Zoom meeting so he can walk them through Dynamic Action! 

What are Dynamic Actions? 

Dynamic Actions are part of a suite of low-code suits that allow System Administrators to add visibility rules to show and/or hide quick actions to ensure users only see what is important to them at the right time.

I hope, by now, you understand what Salesforce is trying to solve using Dynamic Action – render the right actions, at the right time, to the right user!

Dynamic Actions brings point-and-click customization for quick actions into the Lightning App Builder. When you click on a highlights panel component, you will see a new setting in the properties pane to add rules for each action.

A Step-by-step Guide to Implementing Dynamic Actions 

Rakesh started with Sergio’s business requirement – Show the Clone with Related action on an Opportunity record page when the stage is Closed Won and users – with either System Administrator or Sales Manager profiles – are viewing the page.   

There are 5 steps involved in solving Sergio’s business requirement using Dynamic Action. First an overview: 

  1. Enable Dynamic Actions
  2. Adding an Action
  3. Adding a condition to show Action based on a field value
  4. Adding a condition to show Action based on a user’s profile 

Step 1: Enable Dynamic Actions

  1. Click Setup | Object Manager | Opportunity
  2. Then click Lightning Record Pages.
  3. Clicks on the Opportunity Record Page and then click on Edit
  4. Now that we have opened the Opportunity record page in the Lightning App Builder, let us enable dynamic actions by selecting Enable Dynamic Actions (Beta, desktop only) (2) in the properties pane, as shown in the following screenshot: 
  5. Click Save.

Step 2: Adding an Action 

  1. Click Add Action
  2. In the Actions modal, choose an action i.e. Clone with Related, as shown in the following screenshot:
  3. Once you are done, click Done. 
  4. Click Save.

Step 3: Adding a condition to show Action based on Record Field 

Salesforce allows you to specify action visibility based on record field, device type, and other filters, to control which actions appear for which users.

  1. Click Clone with Related Action 
  2. In the Actions modal, choose an action and click + Add Filter
  3. Then define the rule to check if the Opportunity Stage = Closed Won, as shown in the following GIF: 
  4. Once you are done, click Done. 
  5. Click Save.

Step 4: Adding a condition to show Action based on a User’s Profile 

Sergio’s requirement has one more condition to check – the user’s profile – to make sure that action only displays to users with the System Administrator or Sales Manager profiles. To achieve this, let us add a few more conditions. 

  1. Click Clone with Related Action 
  2. In the Actions modal, choose an action and click + Add Filter
  3. Add conditions to check logged-In user profiles, as shown in the screenshot:
  4. Once you are done, click Done. 
  5. Click Save.

Proof of Concept

Next time, when a Sales Manager or a System Administrator creates, or updates, an opportunity to Closed Won – It will automatically display the Clone with Related action.

Benefits of Dynamic Actions

Dynamic Actions certainly improve user experiences in Lightning Experience. Here are the key benefits of using dynamic actions:

  1. It reduces the number of Page Layouts needed to manage the different needs of different users.
  2. Use a single assignment model for the Lightning page instead of the dual model of assigning a Lightning page and a Page Layout.
  3. Manage the actions in the Lightning App Builder without touching the Page Layout editor.
  4. Great way to reduce the amount of information presented to your users at a given time.

Formative Assessment:

I want to hear from you!  

What is one thing you learned from this post? How do you envision applying this new knowledge in the real world? 

Let me know by Tweeting me at @automationchamp, or find me on LinkedIn.

Proofreader: - Munira Majmundar
Have feedback, suggestions for posts, or need more information about Salesforce online training offered by me? Say hello, and leave a message!

3 thoughts on “Dynamic Actions – Taking User Experience to the Next Level in Lightning Experience, indeed!!

  1. Thank you for this very clear and well-presented tutorial! It is unfortunate that this feature is not available yet for mobile. In this scenario, what would you suggest Admins do to help the mobile users?

    1. I agree – Dynamic features is not yet available for mobile (for many objects). Admins can still use “Salesforce Mobile and Lightning Experience Actions” to show/hide actions on the mobile.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.