From 2bd40a50f62fa8e8ee7ab6f01ffb9848e2badb83 Mon Sep 17 00:00:00 2001 From: "grafana-delivery-bot[bot]" <132647405+grafana-delivery-bot[bot]@users.noreply.github.com> Date: Wed, 6 Sep 2023 11:44:11 -0400 Subject: [PATCH] [v10.1.x] Docs: Add basic query option descriptions (#74467) Docs: Add basic query option descriptions (#74419) * fixes 66291 * Update docs/sources/dashboards/variables/add-template-variables/index.md Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com> * Update docs/sources/dashboards/variables/add-template-variables/index.md Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com> --------- Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com> (cherry picked from commit 9319a906b2d797c0c9fca509bce1f34736cc3331) Co-authored-by: David Allen --- .../sources/dashboards/variables/add-template-variables/index.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/sources/dashboards/variables/add-template-variables/index.md b/docs/sources/dashboards/variables/add-template-variables/index.md index 234dce7cf91..f87e13e3378 100644 --- a/docs/sources/dashboards/variables/add-template-variables/index.md +++ b/docs/sources/dashboards/variables/add-template-variables/index.md @@ -97,6 +97,7 @@ Query expressions are different for each data source. For more information, refe - **On Time Range Change:** Queries the data source when the dashboard time range changes. Only use this option if your variable options query contains a time range filter or is dependent on the dashboard time range. 1. In the **Query** field, enter a query. - The query field varies according to your data source. Some data sources have custom query editors. + - Make sure that the query returns values named `__text` and `__value` as appropriate in your query syntax. For example, in SQL, you can use a query such as `SELECT hostname AS __text, id AS __value FROM MyTable`. Queries for other languages will vary depending on syntax. - If you need more room in a single input field query editor, then hover your cursor over the lines in the lower right corner of the field and drag downward to expand. 1. (Optional) In the **Regex** field, type a regex expression to filter or capture specific parts of the names returned by your data source query. To see examples, refer to [Filter variables with regex]({{< relref "#filter-variables-with-regex" >}}). 1. In the **Sort** list, select the sort order for values to be displayed in the dropdown list. The default option, **Disabled**, means that the order of options returned by your data source query will be used.