Is it possible to set the Dashboard Time Range from a variable?

I have a time range variable that I fetch from InfluxDB. I want that by default, the dashboard should select the time range based on the latest absolute value of this variable.

for ex: In the dashboard , I set a variable using following query
SHOW TAG VALUES WITH KEY = “DtFromRange”

It gives me values similar to this:12/21/21 15:23:49 . Similarly for

SHOW TAG VALUES WITH KEY = “DtToRange”

Now What I want to do is, in the dashboard time range in ‘From’ field I want to apply latest value from DtFromRange and in ‘To’ field latest value from DtToRange. By default always by the latest value of the query since there will be multiple values selected by the query.

Is this possible using Grafana+InfluxDB

If you are trying to interpolate variables into Grafana’s dashboard timepicker, I’m not sure that’s possible.

But you should still explore the full potential of chained variables, which can do all kinds of things (if you’re willing to work for it :laughing: )

Here are some useful starting points and example dashboards in our public sandbox :+1: