How to use current time range in url link to next dashboard

I have panel with link to detail dashboard.
I can specify time from and to in dashboard link …&from=now-2h&to=now…
How I can specify in URL params, that I want to use current time range of current dashboard from where I navigate to new dashboard?

1 Like

I also have this question. Was a solution provided?

I also have this question. Was a solution provided?

Same problem.
I did not find a solution. And yet it’s been a while since I’m looking for …

If you use a query, you can pass the values ​​$ __ timeFrom () AND $ __ timeTo () as columns in SELECT, and in the column style, put it as the hidden type and use the column link parameter {__cell_2} as an example.


SELECT [FILA_URA], count(*) AS QTDE, REPLACE(CONVERT(VARCHAR(10), __timeFrom(), 120),'-','') AS dt_ini, REPLACE(CONVERT(VARCHAR(10), __timeTo(), 120),’-’,’’) AS dt_fim
WHERE DATA_HORA BETWEEN __timeFrom() AND __timeTo()


With date and time:
REPLACE(REPLACE(REPLACE(CONVERT(VARCHAR(19), __timeFrom(), 120),'-',''),'T',' '),':','') AS dt_ini, REPLACE(REPLACE(REPLACE(CONVERT(VARCHAR(19), __timeTo(), 120),’-’,’’),‘T’,’ ‘),’:’,’’) AS dt_fim


If you want to add a time interval for your link - use time variables: &from={__from}&to={__to}.



Can you explain how to define these variable ?

Thanks & Regards,

1 Like

These are predefined variables. They do not need to be defined additionally.
Here is an example of a link to another panel from a recent project:
http: //localhost:3000 / d / Nf2eNY_Wk / ProdPanel? orgId = 1 & fullscreen & panelId = 12 & from = {__from} & to = {__to}

from = {__from} & to = {__to} worked for me.


&from=${__from}&to=${__to} worked for me

Better to use ${__url_time_range} which keep relative format (i.e. now)

1 Like

So here is what I did. Since we are using elasticsearch we can get the PIT for data which is in epoch. So I converted it to date time and the just used the “to” for the end.


The data link then provides ~X hours from current date. I never could get a ${__value.time:date::YYYY-MM-DD} + 1h or something to work.

Seems like a minor bug in chrome once we choose the time range instead of overriding the existing URL range it appends to it
i guess it might be due to how the = is interpreted as %3D in URL

ref: squad&from%3Dnow-6h%26to%3Dnow&from=now-24h&to=now

or ${__url_time_range} is resulting in %3D instead of =
tried in chrome & safari as well

Hello @sathishsms !
I’m experiencing the same issue (%3D breaking the URL). Did you ever find a solution / workaround?
&from=${__from}&to=${__to} is an option but relative time range is lost, as @loganmzz mentioned earlier.
Thank you,

Hi @kkevvai
I use the templating variable I mentionned above: ${__url_time_range} and it works like a charm.

1 Like

@kkevvai @saymeagain

I am trying to get epoch time (Current time to -12hrs time) in my Panel URL .Below is the URL I am using in my alert -

But the output is not as expected , PFB screenshot -

This is the URL which got generated in alert-
Panel URL = http://localhost:3000/d/OlH8LAXnk/new-dashboard?orgId=1&from=({__from}&to=)&viewPanel=6

Please suggest how to fix this.

I use the templating variable I mentionned above: ${__url_time_range} and it works like a charm.