---
title: "Dashboard controls | Grafana documentation"
description: "Add and manage a dashboard controls"
---

> For a curated documentation index, see [llms.txt](/llms.txt). For the complete documentation index, see [llms-full.txt](/llms-full.txt).

# Dashboard controls

In the **Dashboard controls** section of the sidebar, you can add variables, annotation queries, dashboard links, and controls to filter and group data, without leaving the dashboard.

[](/media/docs/grafana/dashboards/screenshot-dashboard-controls-v13.1.png)

## Add filters and group by controls

> Note
> 
> The **Filter and Group by** feature renames the **Ad hoc filters** variable and extends it by adding grouping for Prometheus and Loki data sources. However, in the dashboard schema, it’s still referred to as `"kind": "AdhocVariable"` under the `variables` schema property.

To add filters and group by controls, follow these steps:

01. Navigate to the dashboard you want to update.
02. Click **Edit**.
03. Click the **Add new element** icon (blue plus sign).
04. Click **Filter and Group by**.
05. Enter a **Name** for the filter.
06. (Optional) In the **Label** field, enter the display name for the filter drop-down list.
    
    If you don’t enter a display name, then the drop-down list label is the filter name.
07. (Optional) In the **Description** field, enter a description of the filter. The description appears as an info icon tooltip next to the filter name on the dashboard.
    
    Descriptions support links. You can use Markdown-style links (`[link text](https://example.com)`) or paste bare URLs (`https://example.com`). Only `http` and `https` URLs are rendered as clickable links—other protocols are displayed as plain text.
08. Choose a **Display** option:
    
    - **Above dashboard**: The filter drop-down list displays above the dashboard with the filter **Name** or **Label** value. This is the default.
    - **Above dashboard, label hidden**: The filter drop-down list displays above the dashboard, but without showing the name of the filter.
    - **Controls menu**: The filter is displayed in the dashboard controls menu instead of above the dashboard. The dashboard controls menu appears as a button in the dashboard toolbar.
    - **Hidden**: No filter drop-down list is displayed on the dashboard.
09. Under the **Filter options** section of the page, set the following options:
    
    Expand table
    
    | Option                    | Description                                                                                                                                                                                                                                                                                                       |
    |---------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
    | Data source               | Select a target data source in the drop-down list. You can also click **Open advanced data source picker** to see more options, including adding a data source (Admins only). For more information about data sources, refer to [Add a data source](/docs/grafana-cloud/connect-externally-hosted/data-sources/). |
    | Default filters           | Set a default key/value pair. Optional. In the dashboard filter control, the default value is indicated with an information icon.                                                                                                                                                                                 |
    | Enable group by           | This option only appears if you selected a Prometheus or Loki data source. Toggle the switch on to enable data grouping.                                                                                                                                                                                          |
    | Default group by          | Set a default key for the dashboard. Optional. In the dashboard filter control, the default value is indicated with an information icon.                                                                                                                                                                          |
    | Use static key dimensions | To provide the filter dimensions as comma-separated values (CSV), toggle the switch on, and then enter the values in the space provided. Optional.                                                                                                                                                                |
    | Allow custom values       | Toggle the switch on to allow dashboard users to add custom values to the filter and group by lists. Optional.                                                                                                                                                                                                    |
10. Click **Save**.
11. Enter an optional description of your dashboard changes, and then click **Save**.
12. Click **Exit edit**.

For more detailed information on the **Filter and Group by** option, refer to the full [Filter and group by controls documentation](/docs/grafana/latest/visualizations/dashboards/build-dashboards/filter-group-by/).

## Add variables

To add a variable, follow these steps:

01. Navigate to the dashboard you want to update.
02. Click **Edit**.
03. Click **+ Add variable** at the top of the dashboard or click the **Add new element** icon (blue plus sign) and select **Variable**.
04. Choose a variable type from the list.
    
    You can update the variable type by clicking **Change type** in the sidebar.
05. Enter a **Name** for the variable.
06. (Optional) In the **Label** field, enter the display name for the variable drop-down list.
    
    If you don’t enter a display name, then the drop-down list label is the variable name.
07. (Optional) In the **Description** field, enter a description of the variable. The description appears as an info icon tooltip next to the variable name on the dashboard.
    
    Descriptions support links. You can use Markdown-style links (`[link text](https://example.com)`) or paste bare URLs (`https://example.com`). Only `http` and `https` URLs are rendered as clickable links—other protocols are displayed as plain text.
08. Choose a **Display** option:
    
    - **Above dashboard** - The variable drop-down list displays above the dashboard with the variable **Name** or **Label** value. This is the default.
    - **Above dashboard, label hidden** - The variable drop-down list displays above the dashboard, but without showing the name of the variable.
    - **Controls menu** - The variable is displayed in the dashboard controls menu instead of above the dashboard. The dashboard controls menu appears as a button in the dashboard toolbar.
    - **Hidden** - No variable drop-down list is displayed on the dashboard.
09. Complete the variable configuration. For more detailed configuration information, click the one of the following links to complete the steps for adding your selected variable type:
    
    - [Query](/docs/grafana/latest/visualizations/dashboards/variables/#add-a-query-variable)
    - [Custom](/docs/grafana/latest/visualizations/dashboards/variables/#add-a-custom-variable)
    - [Textbox](/docs/grafana/latest/visualizations/dashboards/variables/#add-a-text-box-variable)
    - [Constant](/docs/grafana/latest/visualizations/dashboards/variables/#add-a-constant-variable)
    - [Data source](/docs/grafana/latest/visualizations/dashboards/variables/#add-a-data-source-variable)
    - [Interval](/docs/grafana/latest/visualizations/dashboards/variables/#add-an-interval-variable)
    - [Switch](/docs/grafana/latest/visualizations/dashboards/variables/#add-a-switch-variable)
10. Click **Save**.
11. (Optional) Enter a description of the changes you’ve made.
12. Click **Save**.
13. Click **Exit edit**.

For more detailed information on variables, refer to the full [Variables documentation](/docs/grafana/latest/visualizations/dashboards/variables/add-template-variables/).

## Add annotation queries

To add an annotation query, follow these steps:

01. Navigate to the dashboard you want to update.
02. Click **Edit**.
03. Click the **Add new element** icon (blue plus sign).
04. Click **Annotation query**.
05. Enter a name for the annotation query.
    
    This name is given to the toggle that allows you to enable/disable showing annotation events from this query.
06. If you don’t want to use the annotation query right away, clear the **Enabled** checkbox.
07. Select a color for the event markers.
08. Select one of the following options in the **Show annotation controls in** drop-down list to control where annotations are displayed:
    
    - **Above dashboard** - The annotation toggle is displayed above the dashboard. This is the default.
    - **Controls menu** - The annotation toggle is displayed in the dashboard controls menu instead of above the dashboard. The dashboard controls menu appears as a button in the dashboard toolbar.
    - **Hidden** - The annotation toggle is not displayed on the dashboard.
09. In the **Show in** drop-down, choose one of the following options:
    
    - **All panels** - The annotations are displayed on all panels that support annotations.
    - **Selected panels** - The annotations are displayed on all the panels you select.
    - **All panels except** - The annotations are displayed on all panels except the ones you select.
    
    [Annotation filtering](/media/docs/grafana/dashboards/screenshot-annotation-filtering-10-v2.png)
10. To add a query, do one of the following:
    
    - Click **Open query editor** to open **Annotation Query** dialog box and write or construct a query. The annotation query options are different for each data source. For information about annotations in a specific data source, refer to the specific [data source](/docs/grafana/latest/datasources/) topic.
    - Click **Use saved query** to open a the **Saved queries** drawer and select a [saved query](/docs/grafana/latest/visualizations/panels-visualizations/query-transform-data/#saved-queries).
    
    > Note
    > 
    > [Saved queries](/docs/grafana/latest/visualizations/panels-visualizations/query-transform-data/#saved-queries) is currently in [public preview](/docs/release-life-cycle/) in Grafana Enterprise and Grafana Cloud only.
11. (Optional) Click **Test annotation query** to ensure that the query is working properly.
12. Click **Close** when you’ve completed the query setup.
13. Click **Save**.
14. (Optional) Enter a description of the changes you’ve made.
15. Click **Save**.
16. Click **Exit edit**.

For more detailed information about annotations, refer to the full [Annotations documentation](/docs/grafana/latest/visualizations/dashboards/build-dashboards/annotate-visualizations/).

## Add links

For more detailed information on dashboard links, refer to the full [Dashboard links documentation](/docs/grafana/latest/visualizations/dashboards/build-dashboards/manage-dashboard-links/).

### Add links to dashboards

To add a link to another dashboard at the top of your current dashboard, follow these steps:

01. Navigate to the dashboard you want to update.
02. Click **Edit**.
03. Click the **Add new element** icon (blue plus sign).
04. Click **Link**.
    
    The default link type is **Dashboards**.
05. In the **With tags** drop-down list, enter tags to limit the linked dashboards to only the ones with the tags you enter.
    
    If you don’t add any tags, Grafana includes links to all other dashboards.
06. Set link options:
    
    - **Show as dropdown** – If you are linking to lots of dashboards, then you probably want to select this option and add an optional title to the dropdown. Otherwise, Grafana displays the dashboard links side by side across the top of your dashboard.
    - **Include current time range** – Select this option to include the dashboard time range in the link. When the user clicks the link, the linked dashboard opens with the indicated time range already set. **Example:** [https://play.grafana.org/d/000000010/annotations?orgId=1&amp;from=now-3h&amp;to=now](https://play.grafana.org/d/000000010/annotations?orgId=1&from=now-3h&to=now)
    - **Include current template variable values** – Select this option to include template variables currently used as query parameters in the link. When the user clicks the link, any matching templates in the linked dashboard are set to the values from the link. For more information, see [Dashboard URL variables](/docs/grafana/latest/dashboards/build-dashboards/create-dashboard-url-variables/).
    - **Open link in new tab** – Select this option if you want the dashboard link to open in a new tab or window.
    - **Show in controls menu** – Select this option to display the link in the dashboard controls menu instead of at the top of the dashboard. The dashboard controls menu appears as a button in the dashboard toolbar.
07. Click **Save**.
08. (Optional) Enter a description of the changes you’ve made.
09. Click **Save**.
10. Click **Exit edit**.

### Add a URL link to a dashboard

Add a link to a URL at the top of your current dashboard. You can link to any available URL, including dashboards, panels, or external sites. You can even control the time range to ensure the user is zoomed in on the right data in Grafana.

To add a URL link to your dashboard, follow these steps:

01. Navigate to the dashboard you want to update.
02. Click **Edit**.
03. Click the **Add new element** icon (blue plus sign).
04. Click **Link**.
05. In the **Type** drop-down list, select **Link**.
06. In the **URL** field, enter the URL to which you want to link.
    
    Depending on the target, you might want to include field values. **Example:** [https://github.com/grafana/grafana/issues/new?title=Dashboard%3A%20HTTP%20Requests](https://github.com/grafana/grafana/issues/new?title=Dashboard%3A%20HTTP%20Requests)
07. In the **Tooltip** field, enter the tooltip you want the link to display when the user hovers their mouse over it.
08. In the **Icon** drop-down, choose the icon you want displayed with the link.
09. Set link options; by default, these options are enabled for URL links:
    
    - **Include current time range** – Select this option to include the dashboard time range in the link. When the user clicks the link, the linked dashboard opens with the indicated time range already set. **Example:** [https://play.grafana.org/d/000000010/annotations?orgId=1&amp;from=now-3h&amp;to=now](https://play.grafana.org/d/000000010/annotations?orgId=1&from=now-3h&to=now)
    - **Include current template variable values** – Select this option to include template variables currently used as query parameters in the link. When the user clicks the link, any matching templates in the linked dashboard are set to the values from the link.
    - **Open link in new tab** – Select this option if you want the dashboard link to open in a new tab or window.
    - **Show in controls menu** – Select this option to display the link in the dashboard controls menu instead of at the top of the dashboard. The dashboard controls menu appears as a button in the dashboard header.
10. Click **Save**.
11. (Optional) Enter a description of the changes you’ve made.
12. Click **Save**.
13. Click **Exit edit**.

## Manage dashboard controls

After you add dashboard controls, you can manage them from the dashboard options. In this view, the sidebar includes collapsible sections for filters, variables, annotations, and links, including hidden controls that aren’t otherwise visible on the dashboard:

[](/media/docs/grafana/dashboards/screenshot-dashboard-controls-mgmt-v13.1.png)

To manage dashboard controls, follow these steps:

1. Click the **Dashboard options** icon in the sidebar.
2. In the sidebar, expand the appropriate collapsible section.
3. Do one or more of the following:
   
   - **Edit**: Click **Select** on the control to open it in the sidebar so you can make updates.
   - **Reorder**: Drag and drop controls to reorder them.
   - **Change display**: Drag and drop controls between sub-sections **Above dashboard**, **Controls menu**, and **Hidden** to update the control display option. Note that links can’t be hidden.
   
   > Tip
   > 
   > To get back to controls management from configuration, click the **Dashboard options** icon.
4. Make any other changes as needed.
5. Click **Save**.
6. (Optional) Enter a description of the changes you’ve made.
7. Click **Save**.
8. Click **Exit edit**.
