> ## Documentation Index
> Fetch the complete documentation index at: https://koreai.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Custom Dashboards

The **Custom Dashboards** page lets you build project-shared dashboards from governed SQL queries and visualizations. You create a dashboard, query your data with SQL against the platform tables, and save each visualization as a widget, every dashboard is shared across the project.

Navigation: **Project** → **Custom Dashboards**

Date range: Set at the top of the dashboard, for example **Last 7 days**. Widgets that use the `from` and `to` date tokens follow this range, all applicable widgets update.

When a project has no dashboards, the page shows **No dashboards yet**. Select **New dashboard** to create your first one.

<img src="https://mintcdn.com/koreai/5wWtUILfu_LSTVP6/agent-platform/images/custom-dashboards.png?fit=max&auto=format&n=5wWtUILfu_LSTVP6&q=85&s=ea35a4c6117e9b65bf261e1b85512a5e" alt="Customer Dashboards" width="1534" height="660" data-path="agent-platform/images/custom-dashboards.png" />

### Dashboard actions

| Action            | Description                                                                                                |
| ----------------- | ---------------------------------------------------------------------------------------------------------- |
| **New dashboard** | Creates an empty dashboard that you name and populate with widgets.                                        |
| **Import**        | Loads a dashboard definition from a file.                                                                  |
| **Export**        | Saves the selected dashboard's definition to a file, so you can move it between projects or keep a backup. |
| **Refresh**       | Re-runs the queries behind the dashboard's widgets and redraws them with the latest data.                  |
| **Edit**          | Opens the dashboard for changes, such as adding, arranging, or removing widgets.                           |
| **Time range**    | Sets the dashboard date range that date-scoped widgets follow.                                             |

### Build a widget

Each visualization on a dashboard is a widget. You build a widget in the widget editor, which opens as **Untitled widget** with three tabs.

| Tab              | What you do                                                     |
| ---------------- | --------------------------------------------------------------- |
| **Query data**   | Pick a table and write the SQL that returns your data.          |
| **Preview rows** | Inspect the rows the query returns before you visualize them.   |
| **Visualize**    | Turn the result set into a chart and configure how it displays. |

To build a widget:

1. Open a dashboard and start a new widget.
2. On **Query data**, select a table from the table list, for example `abl_platform.platform_events`.
3. Write your SQL, or use **Columns** to insert column names. Select **Run query** to test it.
4. Open **Preview rows** to confirm the query returns what you expect.
5. Open **Visualize** and choose how to display the result set.
6. Select **Save widget**. To discard your changes, select **Cancel**.

### Example of Query scoping

The platform scopes queries to the current tenant and project by default. Let us consider `abl_platform.platform_events` as the query table. Use the date tokens when a widget should follow the dashboard date range.

| Token                  | Description                              |
| ---------------------- | ---------------------------------------- |
| `{tenantId:String}`    | Scopes the query to the current tenant.  |
| `{projectId:String}`   | Scopes the query to the current project. |
| `{from:DateTime64(3)}` | Start of the dashboard date range.       |
| `{to:DateTime64(3)}`   | End of the dashboard date range.         |

The following query counts events over time and follows the dashboard date range:

```sql theme={null}
SELECT
  timestamp,
  count() AS rows
FROM abl_platform.platform_events
WHERE tenant_id = {tenantId:String}
  AND project_id = {projectId:String}
  AND timestamp >= {from:DateTime64(3)}
  AND timestamp <= {to:DateTime64(3)}
GROUP BY timestamp
ORDER BY timestamp DESC
LIMIT 100
```
