Variables do not update on "refresh"

  • What Grafana version and what operating system are you using?
    Grafana v12.1.0 (ccd7b6ce7e)

  • What are you trying to achieve?
    I am using variables to calculate today, yesterday, this week etc. based input data from an Influx DB to be used in several queries.


    that leads to a unix timestamp

  • How are you trying to achieve it?
    each morning I do a refresh of the dashboard, but the variable id not updating - instead i need to click “edit” on the Dashboard and then simpy save the dashboard without any changes, but I need to select the option"update default variables values"

  • What happened?
    variable stays on old value after refresh of the dashboard

  • What did you expect to happen?
    variables should refresh when refreshing the dashboard

  • Can you copy/paste the configuration(s) that you are having problems with?

  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.

  • Did you follow any online instructions? If so, what is the URL?

This means you are saving a new default value into that variable every day. Try: edit the dashboard JSON model manually and remove any default value for that dashboard variable, and save the dashboard.

Tx for the feedback - that doesnt make sense to me? the variable always has a value - my expectation would be that when I am refreshing the Dashboard the variables will be refreshed as well (run the underlying query of the variable) and the value will be updated

example of json data:

 {
        "current": {
          "text": "1704063600000000000",
          "value": "1704063600000000000"
        },
        "datasource": {
          "type": "influxdb",
          "uid": "ea5616d0-69d9-46e9-a58c-6028bf4fabb9"
        },
        "definition": "select last(LetztesJahr_TS) from Statistik",
        "hide": 2,
        "includeAll": false,
        "name": "LetztesJahr",
        "options": [],
        "query": "select last(LetztesJahr_TS) from Statistik",
        "refresh": 1,
        "regex": "",
        "type": "query"
      }

It makes sense: current is empty, so it will execute the query and use the result as the value. Current is not empty - the user saved that value as a current, so I will show it as a current value.

So did you try that?

deleted the content of one variable (today) - get back to dashboard - received the error


after refreshing dashboard the variable is updated and the error is gone - lets see what will happens tomorrow; as stated in the error message: the variable will not update to the new value

I didn’t mention to delete anything. Set "current": {}

this is what I did - deleted the content in the json file of the dashboard.

still not working - the variables are not updating to the new value when refreshing the dashboard. When I edit the variable and click “run query” its updating the value.