How to get Text of selected template variable in Grafana

3k Views Asked by At

Grafana version 7.3.3. I have a Custom variable created on top of JSON Datasource. Below payload I used to populate the variable options $Project [{"text": "Proj1", "value": "1"}, {"text": "Proj2", "value": "2"}].

Now for the templating query I want to use text of selected $Project dropdown . For e.g. fields.Project:$Project.__text something like this . But I am only getting the value of selected variable $Project not the text.
Is there is a way to get it .

1

There are 1 best solutions below

2
On

I have found a solution:

${variable_name:text}