Docs: Clarify difference between "Add" and "Replace" for saved queries (#113318)

This commit is contained in:
Isabel Matwawana
2025-10-31 17:25:59 -04:00
committed by GitHub
parent 10833172b9
commit 16a0f6c86e
5 changed files with 56 additions and 44 deletions
@@ -137,7 +137,7 @@ Saved queries are available in:
You can see a list of these queries in the **Saved queries** drawer:
{{< figure src="/media/docs/grafana/dashboards/screenshot-saved-queries-v12.3.png" max-width="550px" alt="List of saved queries and the edit query form" caption="The Saved queries drawer accessed from Dashboards" >}}
{{< figure src="/media/docs/grafana/dashboards/screenshot-saved-queries-v12.3.png" max-width="550px" alt="List of saved queries and the edit query form" caption="The **Saved queries** drawer accessed from Dashboards" >}}
When you first open the drawer, the list of queries in the **All** tab is filtered by the data source of the panel.
However, you can clear that filter to display all saved queries.
@@ -156,13 +156,11 @@ In the **Saved queries** drawer, you can:
- Edit a query title, description, tags, or the availability of the query to other users in your organization. By default, saved queries are locked for editing.
- When you access the **Saved queries** drawer from Explore, you can use the **Edit in Explore** option to edit the body of a query.
To access your saved queries, click **+ Add from saved queries** in the query editor:
To access your saved queries, click **+ Add from saved queries** or **Replace with saved query** in the query editor:
{{< figure src="/media/docs/grafana/panels-visualizations/screenshot-add-from-saved-2-v12.2.png" max-width="750px" alt="Add a saved query" >}}
{{< figure src="/media/docs/grafana/dashboards/screenshot-use-saved-queries-v12.3.png" max-width="750px" alt="Access saved queries" >}}
If you've already entered a query, you also have the option to replace it with a saved one:
{{< figure src="/media/docs/grafana/panels-visualizations/screenshot-replace-w-saved-v12.2.png" max-width="750px" alt="Replace a query with a saved one" >}}
Clicking **+ Add from saved queries** adds an additional query, while clicking **Replace with saved query** updates your existing query.
#### Save a query
@@ -221,12 +219,9 @@ To add a query, follow these steps:
For more information about query options, refer to [Query options](#query-options).
1. To add a query, do one of the following:
1. To create a query, do one of the following:
- Write or construct a query in the query language of your data source.
- Click **+ Add from saved queries** to reuse a saved query.
- Click the **Replace with saved query** button (or icon) to reuse a saved query.
1. (Optional) To save the query for reuse, click the **Save query** button (or icon).
- Click **Replace with saved query** to reuse a saved query.
{{< admonition type="note" >}}
[Saved queries](#saved-queries) is currently in [public preview](https://grafana.com/docs/release-life-cycle/). Grafana Labs offers limited support, and breaking changes might occur prior to the feature being made generally available.
@@ -234,6 +229,9 @@ To add a query, follow these steps:
This feature is only available on Grafana Enterprise and Grafana Cloud.
{{< /admonition >}}
1. (Optional) To [save the query](#save-a-query) for reuse, click the **Save query** button (or icon).
1. (Optional) Click **+ Add query** or **Add from saved queries** to add more queries as needed.
1. Click **Run queries**.
Grafana queries the data source and visualizes the data.