Dashboards provide users with key performance measures and status updates. In this article, you’ll learn how to create a dynamic dashboard in Salesforce Lightning. We will start by creating a lightning component that will hold status values and field values as they change over time. Then we will integrate that component into the lightning page using Force.com data visualizations and Lightning Connect.
Are you looking to make your Salesforce Lightning experience even more immersive? Is there something more you’d like to see on the homepage of your desktop application? At Trailhead we’ve built a new way to bring together data from across your organization and display it in the Day, Week, or Month view. While this is great news for those who are looking to harness the power of dynamic dashboards, the setup process for these new features is a bit lengthy and can seem a little overwhelming if you’ve never done it before. In order to simplify the process for you, we’ve designed an easy-to-follow guide that will walk you through setting up dynamic dashboards step by step.
Understanding Lightning Report Builder
To better utilize Salesforce dashboards, it’s of key importance to understand the Lightning Report Builder. First, know that reports you create through the builder are known as source reports. Each source report provides data for your components. Different components can have different source reports. However, each component only has one source. Got that?
Next, readers can scope the data, AKA the components, they see in the dashboard to a particular view using filters. Each component has a set of properties that allow you to customize the component to show the data that you want. With these features, you can work more effectively by presenting the most relevant data.
Creating Dashboards in Salesforce Lightning
To create or edit a Salesforce Dynamic Dashboard, navigate to the Dashboards tab, click New Dashboard to create or click on an existing dashboard to edit.
First, when building a new dashboard, name it, add a description if you’d like, and select the right folder for proper organization.
Remember: Be sure to store these reports in folders that the intended dashboard viewers can access. Otherwise, they will not be able to see the results in the component.
To add a component to the dashboard, press + Component.
Choose a source report for the component, then press Select.
Customize how the component displays data, then press Add.
You can arrange or resize the component as you like within the edit grid.
To edit an existing component, press the pencil icon on the component.
To remove a component, press the X on the component.
To add a filter to the dashboard, press + Filter.
From the Field drop-down, select a field to filter on. The drop-down shows fields that can be used to filter all the dashboard’s components.
Next, give the filter a Display Name for easy identification. Then, simply assign values to the filter by clicking Add Filter Value.
Set Up Dynamic Dashboards in Salesforce Classic
- Create folders accessible to all dashboard viewers to store dynamic dashboards and corresponding component source reports.
- From the Dashboards tab, create a new dashboard or editan existing one.
- Click the button next to the View dashboard as field.Note If you don’t have “Manage Dynamic Dashboards” permission, just entera running user and skip to the final step. Enter “*” to see all available users.
- Select Run as logged-in user.
- Optionally, select Let authorized users change running user to enable thosewith permission to change the running user on the dashboard view page.Users with “View My Team’s Dashboards” can view the dashboard as any user below them in the role hierarchy.Users with “View All Data” can edit the dashboard and view it as any user in their organization.Users with “Enable Other User’s Dashboard” can edit the dashboard if they have access to it, even if they aren’t the running user and don’t have “View All Data.”
- Users with “View My Team’s Dashboards” can view the dashboard as any user below them in the role hierarchy.
- Users with “View All Data” can edit the dashboard and view it as any user in their organization.
- Users with “Enable Other User’s Dashboard” can edit the dashboard if they have access to it, even if they aren’t the running user and don’t have “View All Data.”
- Click OK.
- In the View dashboard as field, enter a running user.
- Save your dashboard.
- Set the appropriate Show option onthe report run page. For example, if you choose “MyTeam’s Opportunities,” each dynamic dashboard viewer can seeall opportunities for the team.
Creating a Dynamic Dashboard in Salesforce
Dashboards are a great way to represent data visually within an organization. They can show how you have performed in the past and what’s happening at the moment – two keys to any business that wants to be successful.
Normally, dashboards in Salesforce are run based on one user for the entire organization. Meaning the dashboard looks the same for all users within the organization. This is great if you are trying to display how close your company is to its year-end sales goal, but what if you want each user to see a dashboard of how close they are to their own sales goal?
For Example: John and Mary are both salespeople in your organization whose security settings only allow for them to read sales that they own. Currently, your dashboard showing year-to-date sales figures is a standard dashboard, with the running user set as a system administrator. Therefore, both John and Mary see the dashboard of the year-to-date sales of the entire company. You want to create another dashboard showing both John and Mary their sales numbers individually, without giving one access to the other’s information.
Dynamic dashboards allow each user to see the data they have access to according to the security settings that are in place. Without read access to a record, that record will not be accounted for in the dashboard. This allows you to control data visibility without having to create separate dashboards.
Creating a dynamic dashboard vs. a standard dashboard is essentially the same process, with one major difference. Since a dynamic dashboard should run according to the security settings of a the user who is viewing the dashboard, and not a specified user all the time, the “Running User” selection should be changed from the standard, “Run as Specified User” selection to, “Run as Logged-in User” which changes the security settings on the dashboard to match that of the user who is logged-in at the time of viewing.
Since we already know how to create a standard dashboard, creating a dynamic dashboard will only involve a few extra steps. In fact, by performing the following actions you can also easily change a standard dashboard to a dynamic dashboard. To create a dynamic dashboard, there are two steps – controlling access to the dashboard and controlling access to the data.
In Salesforce Classic, dashboards can be scheduled to automatically refresh its data. Dynamic dashboards, where a dashboard is run based on the logged-in user, cannot be scheduled. However, in Lightning Experience, automated dashboard refreshes are not available at all. A Refresh button is provided on the dashboard instead to manually refresh its data.
To control access to the dashboard:
- In the Dashboards Tab, click on the New Folder button to create a New Dashboard Folder:
- Enter a name for the new Dashboard folder:
- Inside the newly created Dashboard folder, click on the Share button in the dropdown menu to display more options:
- Select the users/roles and access level, and click on the Share button.
- Now your dashboard folder is ready to contain dashboards where only users you have given permissions can gain access. So, on to the second part.
To control access to the data within the dashboard itself, we need to change the settings within the dashboard to run as the logged-in user so that the user logged-in will view the dashboard according to their own security settings. To do this:
- Open the dashboard you need to configure and click on the button with the gear icon to open the Properties window.
- In the View Dashboard as settings, select the option “The dashboard viewer”, which refers to the logged-in user
The option to “Let dashboard viewers choose whom they view the dashboard as” will allow any user with permissions to change the running user when viewing the dashboard. These include users with the following security settings:
- “View My Team’s Dashboards” allows viewing as any user below them in the role hierarchy.
- “View All Data” allows viewing as any user in the organization.
- “Enable Other User’s Dashboard” allows for editing of the dashboard if allowed access, even if they aren’t the running user.
You have now created a dynamic dashboard that will show data according to each user that is logged-in at the time of viewing. Remember, you can create dashboards using many different kinds of visual representation as well as underlying reports, so feel free to get creative!
Let’s take a look at how you can create a dynamic dashboard in Salesforce to view and drill into information for all accounts, opportunities, contacts…etc.