Grafanav7.5.3 - Template Variable Filters - Require Sort option based on user selected items to appear on top of other items in the filter list

Hi Grafana Support,
I am using Grafana version 7.5.3. I am facing a usability issue in template variable filters for which I am either looking for a workaround or a permanent fix.

The issue is I am using around 8 to 10 template variable filters in my dashboard and each filter is having on an average 500 values. Now when I select certain values in the filter list, say for ex: I selected 20 items and assume that all these are exceptions whose string length are quite long. So after selection if I want to know the items selected, the current UI is not that helpful as i have to scroll the entire list for the ticked/selected items. Though hovering on the filter will show the list but that list is incomplete. So my requirement is once an item is selected (and saved) those items should appear on top of other non-selected items in the filter list. In this way the user can easily scroll through 20 rows or what ever items he/she selected at the beginning itself and will be helpful in decision making.

Kindly let me know if there is a way to sort based on user selection feature in template variables or let me know if any PR needs to be raised.

PS: In older version of Grafana ex: v6.7.4 the template variable box was expanding based on the selected items, so if selected 20 items then all 20 items was clearly visible but in the latest version the filter box doesn’t expand.


Hi @avin. I don’t think what you’d like is possible at present. You can raise a feature request on the GitHub repo of course (if one doesn’t exist already).

But a more direct workaround may be to simply create a panel that shows the “full” value of the template variable in question. Like a text panel that contains $my_variable. Would that maybe help?

Hi @svetb, thanks for your response. I will create a feature request for the same as didn’t find any similar to this. The workaround you described doesn’t solve the purpose exactly. So as a usability feature it is good to have the selected ones at the top of the list in the filter.

-Avin