Sub topic 8
Building a dynamic dashboard
This chapter assumes you can build a summary report, create a dashboard with components, and explain how a running user controls visible data. It also assumes you know profiles, roles, and record sharing at a basic level.
What a dynamic dashboard changes
A standard dashboard has a fixed running user. Every viewer sees the data that one person can see. A dynamic dashboard runs as the logged-in user instead. Each viewer sees the data their own access allows, so one dashboard can serve a whole sales team.
The source reports behave the same way they always do. The dashboard simply applies each viewer's sharing and role hierarchy when it loads.
Create the dynamic dashboard
- Open the dashboard in the dashboard editor, or create a new one.
- Click the properties (gear) icon.
- Under View dashboard as, choose The dashboard viewer (Let authorized users choose whom to view the dashboard as).
- Save the dashboard.
Choose the option that matches your goal:
| Setting | Data shown | Typical use |
|---|---|---|
| Run as a specified user | Data visible to that one user | Executive summary shared widely |
| Run as the logged-in user | Data visible to each viewer | Personal pipeline or case queue |
Prepare the source reports
Dynamic dashboards depend on report design. Use a report that already scopes data to the viewer, or rely on sharing to do it.
- Use a report with an open-pipeline grouping, such as the summary below.
- Where sharing is private, the viewer sees only their own records.
- Where the role hierarchy applies, managers see their team's records.
This query returns the grouped totals an open-pipeline report would give a chart component:
SELECT StageName, SUM(Amount) total
FROM Opportunity
WHERE IsClosed = false
GROUP BY StageNameRun as a sales rep with private opportunity sharing, the same component shows only that rep's pipeline. Run as their manager, it also includes the reports below them in the hierarchy.
Confirm which dashboards are dynamic
You can list dynamic dashboards in an org by filtering on the running-user type:
SELECT Id, Title, DeveloperName, FolderName, Type, RunningUserId
FROM Dashboard
WHERE Type = 'LoggedInUser'Behavior to plan for
- Refresh is per viewer. Each person refreshes the dashboard and sees their own data. Scheduled refresh does not apply to dynamic dashboards in the same way, so viewers refresh manually.
- Edition limits apply. Editions cap the number of dynamic dashboards. Count them before you convert many dashboards.
- Folder access still matters. Viewers must have access to the dashboard folder and the folder holding the source reports. Otherwise components show errors or empty results.
- Subscriptions. Subscribing sends the viewer's own view, not a shared copy.
Common mistakes
- Converting an executive dashboard to dynamic, which makes totals differ between viewers.
- Forgetting that users with no record access see empty components, not an error.
- Assuming the dashboard folder grants access to the underlying reports. It does not.
Exercise
A dashboard is set to run as one named manager, and each sales rep opens it. Reps report seeing the manager's whole team pipeline instead of their own. What should you change, and what should you check afterward?
Show answer
Change the running user setting to run as the logged-in user (a dynamic dashboard). Afterward, check that the source reports sit in a folder the reps can access, and test the dashboard as a rep with private opportunity sharing to confirm they see only their own records. Also confirm the org has not reached its dynamic dashboard limit.