3

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 Answer 1

5

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

Sign up to request clarification or add additional context in comments.

2 Comments

${items:value} does the same as ${items}, which is okay, but ${items:text} displays the same, so it doesn't show the labels.
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.