# Templating: On Time Range Change not save when dashboard exported

**URL:** <https://community.grafana.com/t/templating-on-time-range-change-not-save-when-dashboard-exported/1337>\
**Category:** Grafana\
**Tags:** templating\
**Created:** [June 13, 2017, 7:24pm UTC](https://community.grafana.com/t/templating-on-time-range-change-not-save-when-dashboard-exported/1337 "2017-06-13T19:24:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![stevenil](https://avatars.discourse-cdn.com/v4/letter/s/3e96dc/32.png) [@stevenil](https://community.grafana.com/u/stevenil)\
**Post date:** [June 13, 2017, 7:24pm UTC](https://community.grafana.com/t/templating-on-time-range-change-not-save-when-dashboard-exported/1337/1 "2017-06-13T19:24:19Z")

</div>

I have changed the variables on some dashboards to update “On Time Range Change”. When I export the dashboard, and then re-import it, the variables are reverted to “On Dashboard Load”. Is this expected behavior, or a bug. I’m using grafana 4.3.0-beta1.

When I look in the JSON, I see this for the templating

```
    "refresh": 1,

```

But I’m not sure what “1” vs other values mean.

---

<div class="post-metadata">

**Author:** ![daniellee](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/daniellee/32/41_2.png) [@daniellee](https://community.grafana.com/u/daniellee)\
**Post date:** [June 13, 2017, 8:25pm UTC](https://community.grafana.com/t/templating-on-time-range-change-not-save-when-dashboard-exported/1337/2 "2017-06-13T20:25:52Z")

</div>

The part of the code responsible for this behaviour is this [line](https://github.com/grafana/grafana/blob/master/public/app/features/dashboard/export/exporter.ts#L106) where it hard codes the refresh value to 1 on export. This is probably a bug. I’m investigating now and will get back to you shortly.

Footnote: 1 is “On Dashboard Load”, 2 is “On Time Range Change”.

---

<div class="post-metadata">

**Author:** ![daniellee](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/daniellee/32/41_2.png) [@daniellee](https://community.grafana.com/u/daniellee)\
**Post date:** [June 13, 2017, 8:45pm UTC](https://community.grafana.com/t/templating-on-time-range-change-not-save-when-dashboard-exported/1337/3 "2017-06-13T20:45:32Z")

</div>

Yes, a bug. I committed a [fix](https://github.com/grafana/grafana/commit/1f92e589e816f50fc3b5e3a4a60e87521bdb96cf) for this which will be included in the next release of Grafana in a few week’s time. Thanks for reporting this!
