Issue with Variable Mismatch When Redirecting Between Dashboards in Grafana

I have two dashboards in my Grafana setup: a “Plant Overview” dashboard and an “HVAC Overview” dashboard.

In the “Plant Overview” dashboard, I have a dropdown variable Plant with the following data:
[
{
“id”: 1,
“latitude”: 17.09677,
“longitude”: 78.31115,
“name”: “HYDERABAD”
},
{
“id”: 2,
“latitude”: 12.971599,
“longitude”: 77.594566,
“name”: “BANGALORE”
}
]

Based on the selected plant, various visualizations are updated. Additionally, there’s another variable, hvacId, which is fetched dynamically via an API based on the selected plant ID.

variables in Plant Overview dashboard:

In one of the panels in the “Plant Overview” dashboard, I have a panel link to redirect to the “HVAC Overview” dashboard:
“/d/edy8rzwypr18gb/hvac-overview?orgId=1&var-hvacId=${hvacId}”

Problem: When I first navigate from the “Plant Overview” dashboard to the “HVAC Overview” dashboard, the correct hvacId is shown. However, if I go back to the “Plant Overview” dashboard, change the selected plant without refreshing the page, and redirect to “HVAC Overview” again, the dashboard shows the previous hvacId instead of the one for the newly selected plant.

If I refresh the “Plant Overview” dashboard before selecting a new plant and redirecting, the correct hvacId is passed to “HVAC Overview.” But without refreshing, the hvacId seems to remain stuck on the previous plant’s value.

Question: What could be causing this hvacId mismatch when navigating between dashboards without refreshing? Is there a way to ensure the correct hvacId is passed each time a new plant is selected, even without a page refresh? Any help to resolve this would be greatly appreciated!

variables of HVAC overview dashboard :

is this issue related to Plant variable value , that is also not getting updated properly.

Hey @sayyadsalim4100 , I’ve been playing around with this and it looks like the data links in a given panel only update when the panel refreshes, and a change in the template variable you select does not necessarily cause every panel to refresh. Instead, it appears that when you update a template variable, only panels which include that template variable in an actual query will automatically update.

I found two workarounds:

  • You can set your dashboard to auto-refresh, for example every 10 seconds. This will cause all the panels to reload, your panel included.
  • A little trickier but more reliable: in the panel that has the data links, add a non-visible query that uses the template variable. That way, the panel will refresh whenever you change the template variable, and your links will stay up to date.

By the way, despite this workaround, I think we can improve this behavior so I opened a non-urgent GitHub issue: Data links: Data links that include template variable values do not update when I change the template variable · Issue #96044 · grafana/grafana · GitHub