The selection of one variable dynamically filters the options available in another

I am using Infinity plugin and using csv as inline. I have two variables, I want the dependent variable to display only values that are corresponding to the first variable.

Department,Team
Engineering,Backend
Engineering,Frontend
Engineering,DevOps
Sales,Inside
Sales,Field
HR,Recruiting
HR,Payroll

If I select Engineering the second drop down must automatically display Backend, Frontend, DevOps.

What I have done so far:
followed this Grafana dashboard variables depending a common one - #4 by dawiddebowski

Also, tried doing it through UQL and it works but when I try to access the variable in transformations ${Team} it doesn’t work. Please help!

Hi, can you share some screens from the variable configuration? What are the names of the variables? In the linked example, the first variable (In your case the one that would have values Engineering, Sales, HR) was named env and the second variable… I don’t really remember :sweat_smile: but I guess something along query0.
The thing is - the names of the columns do not have to reference to the names of the variables. So if the variable in which you’ve done your config (the provided csv and filtering) is called e.g. my_awesome_variable you should be using ${my_awesome_variable} in your panels, not ${Team}. If you’re using it like that, can you share the screens and explain what do you mean by

transformations ${Team} it doesn’t work.

The variable displays different data? Or it doesn’t work in transformations tab? What Grafana version are you using?

1 Like

there seems to be an issue when chaining parent/child filters
as you can see here I have 2 variables departments and teams

When changing departments the panel below works fine but the teams variable with same identical UQL does not work. Not sure if it is a bug in infinity

the uql being

parse-csv
| where "__value" in (${departments:singlequote})




I did actually use the variable name in my transformations, I accidentally used the column name for referring in the example that I gave. It doesn’t work. Is there another syntax used for referring a UQL query variable?

Please see this solution

1 Like

Thank you so much, you are a savior!! :smiling_face:

@yesoreyeram is the man!