Dasboard variable of Query type - Query Form not shown

I’m in a process of development of a custom datasource and I need to use data returned as option list for dashboard variable. The query needs to be parametrized, but, datasources query form does not display in the dashboard variable definition at all.


On the panel definition, the query form shows up just fine.

With the GitHub - grafana/grafana-starter-datasource: A starter for Grafana data source plugins, I have the same behaviour.
Using Grafana v8.2.1

You need to explicitly set the query editor for the variable query editor. For more information, check out the documentation on using variables in plugins:

Thank you very much, that was exactly it.
Shame on me I did not find it myself.

1 Like

Hi @marcusolsson

I encountered the same issue and Followed the documentation which you mentioned above, Still I am not seeing the query panel is being displayed, on selecting the Query variable type from the dropdown.
I am using the grafana version 9.15.0 So in this version .setVariableQueryEditor is deprecated, So is there any workaround to get this functionality to work.

It would be great help if you could help here.

Thanks
Darshan

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.