Sub topic 3
Creating your first dashboard
This chapter walks you through building a first dashboard in Lightning Experience. It assumes you can create and run a basic report, you know the standard objects (Accounts, Opportunities, Cases), and you have a general idea of how profiles, roles and record sharing control access. Component types, filters and dynamic dashboards get their own chapters later.
What a dashboard is
A dashboard is a page of visual components. Each component reads data from one source report. The dashboard does not store records. It stores a layout, plus a pointer from each component to a report.
Every dashboard has these parts:
- Title and folder. The title names the dashboard. The folder controls who can open it.
- Running user. The user whose access decides which records the components show.
- Components. Charts, gauges, metrics and tables placed in columns.
- Source reports. One report per component. Several components can share a report.
The running user matters from the start. A static dashboard shows every viewer the data the running user is allowed to see, not the data the viewer is allowed to see. The chapter on the running user covers this in detail.
Build the dashboard
Before you start, make sure a suitable report exists. This example uses an Opportunity summary report named "Open Pipeline by Stage". It filters on open opportunities and groups by Stage, with a sum of Amount.
- Open the Dashboards tab and click New Dashboard.
- Enter a name, for example "Sales Pipeline Overview". Choose a folder that you can write to. Click Create.
- In the editor, click + Component.
- Select the report "Open Pipeline by Stage" and click Select.
- Choose a component type. For a first pass, pick a Vertical Bar Chart.
- Set Y-Axis to the sum of Amount and X-Axis to Stage. Click Add.
- Click the Settings (gear) icon. Check the View Dashboard As value. Leave it on a specified user for now.
- Click Save, then Done.
The same grouped totals that the bar chart draws can be listed with a query:
SELECT StageName, SUM(Amount) total
FROM Opportunity
WHERE IsClosed = false
GROUP BY StageNameBecause the report has one grouping and one summary, the chart needs no extra setup. A report with no groupings cannot feed a chart, which is why the previous chapter focused on summary and matrix reports.
Learn the editor
The editor has three areas you will use often.
| Area | Purpose |
|---|---|
| Canvas | Shows components in columns. Drag to reorder or resize. |
| Component menu | Edit, duplicate or delete a component. |
| Properties | Sets the title, theme, running user and filters. |
Edit a component by hovering over it and clicking the pencil icon. A component can also show a title, a subtitle and a footer. Use them to say what the numbers mean. Viewers should not have to open the report to find out.
Check the result
After you save, click Refresh. The dashboard queries each source report again and stamps the time of the refresh at the top. Check three things:
- Each component shows data and not an empty chart.
- The total matches the source report.
- The folder and running user are what you chose.
If a component is empty, open its source report. Look for a report filter that returns no rows, or a running user with no access to the records.
Exercise
A dashboard component shows no data, but the source report returns records when you run it. Which dashboard setting do you check first, and why?
Show answer
Check the running user. A component shows the records the running user can access, so if that user lacks access to the records, the component is empty even though your own report run shows data.