- What Grafana version and what operating system are you using?
Grafana v9.5.0 (4a2e069461)
Google Chrome
Mac osx
- What are you trying to achieve?
I am trying to dynamically adjust the number of flags displayed in a table panel in Grafana based on a user-selected value from a template variable.
- How are you trying to achieve it?
I have created a template variable named num_flags
and configured it to provide a list of numbers from 1 to 50. I am using this variable in a JSON query within a table panel to set the size
field dynamically based on the user’s selection.
- What happened?
The table panel is not displaying the expected number of flags. The table seems to show a fixed number of items, regardless of the value selected in the num_flags
template variable.
- What did you expect to happen?
I expected the table panel to adjust the number of displayed flags according to the value selected in the num_flags
template variable.
- Configuration:
Template Variable num_var
:
- Type: Custom
- Values: 1, 2, 3, …, 50
- Query: None
Query within Table Panel:
jsonCopy code
{
"find": "terms",
"field": "my_field",
"size": "$num_var",
"orderBy": "doc_count",
"query": "my query"
}
- Errors:
No specific errors are displayed in the Grafana UI or related logs. The table panel just doesn’t seem to respond to changes in thenum_flags
variable. - Online Instructions:
I followed the information provided in the official Grafana documentation about using variables in queries: URL