Sub topic 7
The running user and what viewers can see
This chapter explains how the running user setting decides which records a dashboard shows. It covers the three running user options, how they interact with sharing, and the errors that usually follow. It assumes you can create and run a basic report, you know the difference between profiles, roles, and record sharing, and you have built a dashboard with at least one component.
The core idea
A dashboard does not query data on its own. Each component reads a source report, and the report runs as one specific user. That user is the running user. Salesforce applies the running user's record access, not the viewer's, when it builds the dashboard data.
This produces a result that surprises many new administrators. Two people can open the same dashboard and see identical numbers, even though one of them has no access to the underlying records. The viewer sees the running user's view of the data.
The running user is set once per dashboard, not per component. Every component on the dashboard uses the same running user.
The three running user options
The dashboard properties offer these choices under View dashboard as:
| Option | Whose data is shown | Same for every viewer? | Typical use |
|---|---|---|---|
| Run as a specified user | The data visible to one named user | Yes | Executive or company-wide summaries |
| Run as the logged-in user | The data visible to whoever opens the dashboard | No | Personal or team views (a dynamic dashboard) |
| Let dashboard viewers choose whom they view the dashboard as | The data visible to a user the viewer picks | Depends on the choice | Managers reviewing their team |
The third option requires the viewer to have the right permission and to be allowed to see the chosen user's data. Which viewers can choose, and whom they can pick, depends on the org's settings and the viewer's position in the role hierarchy. Check the current Salesforce documentation for the exact rules in your edition.
Run as a specified user
You pick one user, and the dashboard shows what that user can see. This is the default style for shared dashboards.
Consider a dashboard run as a sales vice president who can see all opportunities. A sales representative who opens it sees the pipeline for the whole company. The representative never gains access to those opportunity records. They only see the aggregated results.
The upside is predictability. Everyone sees the same numbers, and the dashboard loads from a single report run. The downside is exposure. Anyone with access to the dashboard folder sees whatever the running user can see, so a highly privileged running user can reveal more than you intend.
Run as the logged-in user
This setting creates a dynamic dashboard. Each viewer sees only the data their own sharing access allows. A sales representative sees their own pipeline, and a regional manager sees their region, according to the role hierarchy and sharing rules. The next chapter covers how to build and manage these dashboards. For now, the key point is that dynamic dashboards are the main tool for showing different people different data from one dashboard definition.
Let viewers choose
This option adds a picker to the dashboard. The viewer selects a person and sees the dashboard as that person. It is useful for one-on-one reviews, where a manager looks at a team member's numbers.
What the running user can see
The running user's access comes from the same layers that control record access everywhere else:
- Object permissions on the profile or permission sets (the user must be able to read the objects in the report).
- Field-level security on the fields used for grouping, filtering, and summarizing.
- Record access from organization-wide defaults, the role hierarchy, sharing rules, teams, and manual shares.
- Report scope, such as My, My team's, or All records, which narrows what the report asks for.
The report scope matters more than many people expect. A report set to My opportunities shows records owned by the running user. If the running user is a single administrator account, a dashboard built from that report shows only that administrator's records, even if the administrator can see everything.
How the layers combine
The following diagram shows the path from a viewer opening a dashboard to the numbers they see.
Report folder access is a separate check
The running user decides which records the data comes from. Folder access decides whether someone can open the dashboard or the report at all. These are two independent checks.
- A viewer needs access to the dashboard's folder to open the dashboard.
- A viewer does not need access to the source report's folder just to see the dashboard components. The dashboard shows its data through the running user.
- A viewer does need access to the source report to click through from a component to the full report.
- The running user must have access to the source report's folder. If the running user loses that access, the components stop working.
This separation is the usual source of confusion. "I can see the dashboard but cannot open the report behind it" is expected behavior and not an error.
Worked example: the same dashboard, three configurations
Suppose a dashboard has a table component of open opportunities by stage. It is built on a summary report. Three users are involved:
- Dana is the VP of Sales and can see all opportunities.
- Sam is a sales representative who sees only the opportunities Sam owns.
- Priya is a regional manager who sees the opportunities owned by her team.
| Configuration | What Sam sees | What Priya sees |
|---|---|---|
| Specified user: Dana | All opportunities | All opportunities |
| Logged-in user | Sam's opportunities | Priya's team's opportunities |
| Viewer chooses, Priya picks Sam | Not applicable | Sam's opportunities |
With Dana as the specified user, Sam sees the whole company's pipeline, which may be more than the business intends. If the goal is a personal view, the logged-in user setting is the correct choice.
You can verify what a running user would see by running the source report directly as a user with similar access. This is faster than checking the dashboard, and it removes the dashboard from the list of suspects.
Changing the running user
You can change the running user in the dashboard properties. Several points apply.
- Changing it affects every component and every viewer at once.
- Changing it to the logged-in user makes the dashboard dynamic, which counts toward your edition's limit on dynamic dashboards.
- Changing a running user to someone with less access can make numbers drop, and components can go empty, with no error message.
- Scheduled refreshes use the running user's access. When the running user is deactivated, scheduled refreshes fail. Pick a stable, long-lived user or a dedicated integration-style user for shared dashboards, and avoid someone who may change roles or leave.
Using a dedicated user for the running user has a trade-off. It decouples the dashboard from any one employee, but you must keep that user's access current as business needs change. Review it when you review the dashboards.
Checking running user types with SOQL
You can read the running user type from the Dashboard object. The Type field shows how the dashboard runs. This query lists the dynamic dashboards in an org:
SELECT Id, Title, DeveloperName, FolderName, Type, RunningUserId
FROM Dashboard
WHERE Type = 'LoggedInUser'The Type value LoggedInUser marks a dashboard that runs as the logged-in user. A value such as SpecifiedUser marks one that runs as a named person. For dashboards that run as a specified user, RunningUserId shows who that is. The later chapter on auditing returns to this with more queries.
Common errors and what causes them
| Symptom | Likely cause | Fix |
|---|---|---|
| A component is empty for everyone | The running user cannot see any matching records, or lost access to the source report's folder | Check the running user's record access and folder access, then refresh |
| A viewer sees more data than expected | The specified running user has broader access than the viewer | Switch to the logged-in user, or use a running user with narrower access |
| A viewer sees less data than expected on a dynamic dashboard | The viewer's own sharing access is narrower than assumed | Review the role hierarchy and sharing rules |
| A dashboard shows only one person's records | The source report scope is My records | Change the report scope to All records or My team's records, as appropriate |
| Scheduled refresh stops working | The running user was deactivated | Assign a new running user and re-save the schedule |
| A viewer cannot open the report behind a component | The viewer lacks access to the report's folder | Share the report folder if the access is appropriate |
Design decisions
Choose the setting by asking who should see which data.
- If every viewer should see the same figures, use a specified user, and pick the user with care.
- If each viewer should see their own data, use the logged-in user.
- If managers need to review team members, use the viewer-choice option.
- If your edition's limit on dynamic dashboards is a problem, consider whether a specified-user dashboard with a dashboard filter would meet the need. A filter narrows data within what the running user can already see, so it cannot grant a viewer any extra access, and it does not replace the logged-in user setting for security.
Exercise
A dashboard runs as the specified user Dana, who can see all opportunities. Sam, a sales representative who owns only some opportunities, opens the dashboard and sees company-wide totals. Sam says this is a data leak. Which setting would you change so that Sam sees only his own opportunities, and what is the trade-off?
Show answer
Change View dashboard as to Run as the logged-in user, which makes the dashboard dynamic. Each viewer then sees only the data their own access allows. The trade-off is that dynamic dashboards count toward an edition limit, and the numbers will differ between viewers, so a shared executive total is no longer the same for everyone.
Exercise
Priya opens a dashboard and sees a table of opportunities, but she receives an insufficient access error when she clicks a component to open the source report. Is the dashboard broken?
Show answer
No. The dashboard shows data through the running user, so Priya only needs access to the dashboard's folder. Opening the source report requires access to the report's folder. To fix it, share the report folder with Priya if that access is appropriate.
Exercise
A scheduled dashboard refresh has stopped working, and the dashboard is run as a specified user. After checking the schedule, what is the next thing to check?
Show answer
Check whether the running user is still active and still has access to the source report's folder. A deactivated running user causes scheduled refreshes to fail. Assign a new, stable running user and save the schedule again.