From 859ee3c8269af3f5ad62a597357ba757fcf4c5f4 Mon Sep 17 00:00:00 2001 From: "Grot (@grafanabot)" <43478413+grafanabot@users.noreply.github.com> Date: Mon, 8 Nov 2021 11:09:47 -0700 Subject: [PATCH] Docs: Added note that only string type is supported for query variables. (#41359) (#41409) * Added note that only string type is supported for query variables. * Added doc review. (cherry picked from commit f346bbb3bb7354b9e77df10f3383a7be10badcb2) Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com> Co-authored-by: achatterjee-grafana --- docs/sources/variables/variable-types/add-query-variable.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/sources/variables/variable-types/add-query-variable.md b/docs/sources/variables/variable-types/add-query-variable.md index 47f7a17ae80..947b0ba082d 100644 --- a/docs/sources/variables/variable-types/add-query-variable.md +++ b/docs/sources/variables/variable-types/add-query-variable.md @@ -8,6 +8,8 @@ weight = 100 Query variables allow you to write a data source query that can return a list of metric names, tag values, or keys. For example, a query variable might return a list of server names, sensor IDs, or data centers. The variable values change as they dynamically fetch options with a data source query. +Query variables are generally only supported for strings. If your query return numbers or any other data type, you may need to convert them to strings in order to use them as variables. For the Azure data source, for example, you can use the [tostring](https://docs.microsoft.com/en-us/azure/data-explorer/kusto/query/tostringfunction) function for this purpose. + Query expressions can contain references to other variables and in effect create linked variables. Grafana detects this and automatically refreshes a variable when one of its linked variables change. ## Query expressions