Infinity plugin + JSON + dashboard variables

Hi,

I’m not master of Infinity Plugin, so it might be not the best answer, but I think what is happening is that Grafana allows you to have key:value pairs as your variable (see this link). As I’ve noticed, if you pass ${var:<whatever>} you’ll get the value of your query, so that’s why it worked with one value and not with three columns.

What you can do is to use a couple of variables. The first one being the list of values of entity fields - let’s call it type variable.


Then you could create another variable (let’s call it price) where you paste your data, select entity and price columns. In Filter option, you pass contains("${type}", entity), which will limit the possible values of your the data only to the ones containing the type variable. In result, you’ll have just one variable which corresponds to the price of the entity you select in your type variable.

You repeat this step for another variable time (which you do analogously to the price variable only changing the column from price to time). You can hide price and time variables. In your visualizations, you’ll use variables price and time wherever you wanted to use testvar.price and testvar.time but your end user will see only one variable to rule them all.

Disadvantages are that you have to create multiple variables and use them, even though they are not presented on the dashboard, but I don’t know better way to do this (and my knowledge says it might be impossible to do it the way you wanted with 3 columns in one variable).

1 Like