The overview dashboard shows a table that renders links per row to the second dashboard. I use $__cell to get the value of the cell and use it in the link template like this: ./d/dashboard2/dashboard2/?var-clientId=$__cell
Second dashboard has variables defined and reads the URL params passed by the link to filter some data.
This all works.
But the time range selection is gone when the link is clicked and the 2nd dashboard is opened. I couldn’t find any way of passing this.
I know dashboards can receive from and to params like this: from=1536315119109&to=1536318719109 and the date range is set. But how can I render the link with that?
Note that, this is not about the “Drilldown / detail link” feature defined on the component level. This is table row level.
Environment:
Grafana 5.0.0, Postgres data source, official Grafana table component
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.
Look:
SELECT [FILA_URA], count(*) AS QTDE, REPLACE(CONVERT(VARCHAR(10), __timeFrom(), 120),'-','') AS dt_ini, REPLACE(CONVERT(VARCHAR(10), __timeTo(), 120),’-’,’’) AS dt_fim
FROM YOUR_TABLE
WHERE DATA_HORA BETWEEN __timeFrom() AND __timeTo()
With date and time use in SELECT:
REPLACE(REPLACE(REPLACE(CONVERT(VARCHAR(19), __timeFrom(), 120),'-',''),'T',' '),':','') AS dt_ini, REPLACE(REPLACE(REPLACE(CONVERT(VARCHAR(19), __timeTo(), 120),’-’,’’),‘T’,’ ‘),’:’,’’) AS dt_fim