2

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 .

curiousguy
  • 3,212
  • 8
  • 39
  • 71

1 Answers1

6

I have found a solution:

${variable_name:text}
  • Vasyan, where did you get that wisdom? I've spent half an hour reading the docs and didn't get it. – dimcha Apr 23 '21 at 17:07
  • Here's a description of this functionality in the Grafana docs: https://grafana.com/docs/grafana/v9.0/variables/advanced-variable-format-options/#text – Steven D. Sep 14 '22 at 20:31