Way to make all values selected of a variable

We have a usecase where we want to repeat rows based on the values in a query variable.
All the rows needs to be visible on load based on the values received in the variable.
Right now only when we open the multi select and user select all values the rows show up.
Is there any way to pre select all values?

Open your variable and find this:

Then back to the dashboard, select all, then save the dashboard and select the tickmark about the current variable.
If you want to make it “automagically”, just hide the variable, then save the dashboard again, in the condition that your variable is ALL

@fadjar340 Thankyou for your reply!!

The values of this variable depends on other two variables which are select dropdowns on dashboard.
If user changes other two dropdowns value for these are reloaded. Will the above work in this case as well.

1 Like

3 years passed, but probably someone else may find this thread.
E.g. I have a variable
cluster_name label_values(somemetric{somelabel="xxx"}, scope)
And another variable which rely on previous one
instance label_values(somemetric{somelabel="xxx",scope="$cluster_name"}, instance)

When selecting All for cluster_name, I expect to have a list of all available instances but it does not happen, I see only “All” value in instance and nothing else.

This can be resolved by setting Custom all value for cluster_name:
image

So I’ve set Custom all value for cluster_name to .*, and changed query for instance:
instance label_values(somemetric{somelabel="xxx",scope=~"$cluster_name"}, instance)

So now when I select cluster_name = All, the instance query “transforms” into:
label_values(somemetric{somelabel="xxx",scope=~".*"}, instance)

and I can see the list of all instances.

5 Likes

thanks - yes, really useful - have to say, seems kinda odd to me that .* isn’t what it gives by default for All

1 Like