Restrict variable so user cannot enter their own values

grafana v10.3.1

I have a custom variable:

In the dashboard, it offers the user the option to type their own values, and it actually works:

image

I only want the user to be able to use the values I provided. How do I do this?

There is no point to have any restriction as you are requesting in the UI - average person can tamper request/variables with developer/browser console anyway.

Oh you mean they could edit the page source or so… that’s fine, the thing is my users would be inclined to simply type a value in the box. I don’t think they would even consider it the other way.

I guess it’s not possible…?

Wow it works even for query variables. What is the point of allowing users to just type anything, always?

Hey @rob.loh, I’ll let you know that typeahead is a cool feature.

You only used some integers and didn’t use some strings in variables yet right? It works wonders. User start typing, and them… It filters the data on the dropdown. That’s why it’s here.

In your case, to help guiding your users, you could just rename the Label for your variable, put something in parenthesis like: “Min_TD (Value between 2 to 6)”

Hope it helps.

Hey @isaqueprofeta , typeahead is a cool feature.

This isn’t just typing ahead, though. This is: I’ll throw whatever you type into the queries, even if it breaks the whole dashboard, or shows you data that should be filtered out.
That is not such a cool feature…

Could this just be a dev feature? Maybe it’s different for a user of a dashboard?

We can still have this while only allowing users to select the values in the dropdown.