Hide/show dashboard variables dynamically

Hi!
I am using Dynamic Text plugin for visualization. I have several dashboard variables that are dropdowns, for example: $main_variable, $var1_if_main_0, $var2_if_main_0, $var1_if_main_1 , etc. I want to show variables depending on $main_variable like: if $main_variable == 0 then show $var1_if_main_0, $var2_if_main_0 and hide $var1_if_main_1.
How can I achieve this?

what is the source data of these variables? db or custom?

All variables are custom

how are sub variables related to $main_variable. can we assume there is data embedded in them from the parent variable?

you need to provide more details, the vaguer your requirement the vaguer the solution provided.

I have main variable:
image
I also have variables that consist of different values:
image
I want to check, for example, whether the $main_variable value is zero and if so, show the variable variable_if_main_0, and hide the variable variable_if_main_1

the way you have it would be tedious if not impossible. do you have access to a database?

dynamic variable

No, I don’t have access to the database. So the only way is to use javascript?

not sure where you got that idea from?

You say that this is nearly impossible, and since I use the dynamic text plugin, I thought that it could be implemented using default html select tag and js

I can filter the data from the query, but I get your idea, it will be more correct and easier. Thanks!

1 Like