1

I have a Grafana dashboard variable named items. The variable is filled with data coming from an API using JSON API data source.

My API response is an array of objects containing two properties: id and name and I have set the name to be the label of my variable. So, in Grafana the dropdown displays a list of names and when I select one or more, it selects the id.

However, I want to display the selected values and labels in a text panel below. How can I do that? In the text panel, I can type $items and this will show a comma-separated list of selected values, but how can I display a comma-separated list of selected labels, too?

1 Answers1

2

Try advance syntax ${items:value} or ${items:text}.

Jan Garaj
  • 25,598
  • 3
  • 38
  • 59
  • `${items:value}` does the same as `${items}`, which is okay, but `${items:text}` displays the same, so it doesn't show the labels. – JrDeveloper Aug 14 '23 at 09:21
  • Quick update: After some restarts (lol), `:text` indeed does return labels separated with a `+` (plus) sign. I do wish I was able to change the plus sign, but it definitely does get the job done. Thanks. – JrDeveloper Aug 14 '23 at 13:11