How to use template variable in another dashboard mysql query

Hi Team,

I have little confused how to bind template variable in mysql query from another dashboard drill down table view, i have also attached image here please give suggestion.

Regards.
Gandhi D

1 Like

Hi,

In the dashboard you link to you need to create a template variable named t_on, i.e. dashboard -> settings -> variables -> add variable.

Marcus

The Question is about How to use Variable named t_on which is shown in URL not stored in variable and i thought there is no need to create template variable as per my knowledge
I know how to crate variable and use it

so suggest proper answer

The question was

how to bind template variable in mysql query from another dashboard drill down table view

You actually need to create a template in a dashboard to be able to provide a value to that variable thru url and later reference variable in query.

Marcus

Can you give one example or link from where i can learn easily?

Have a look at this live demo dashboard: https://play.grafana.org/d/000000143/templating?orgId=1&var-app=country&var-server=All&var-interval=1h. When you change the variables in drop down on top you’ll see that the url are changing.

See documentation as well.

Marcus

I am using Mysql as data source thats why its difficult to me

The example I linked are using Graphite as datasource. If you edit one of the panels in this example, https://play.grafana.org/d/000000143/templating?orgId=1&var-app=country&var-server=All&var-interval=1h&panelId=1&fullscreen&edit, you can see that $app and $server are referenced in the query and those are referneces to the template variables named app and server and that you can change value for in the top of the dashboard.

Please refer to using mysql in grafana documentation for details about using variables with mysql queries.

1 Like

:+1:
I got it and Thanks
Now my problem is solved