GitHub user dosubot[bot] added a comment to the discussion: Automatic refresh
of Dashboards
<!-- Answer -->
Superset doesn't have a built-in way to enforce a fixed auto-refresh interval
for embedded dashboards via config, API, or embedding parameters. The
auto-refresh feature is session-based and controlled by the user's browser, so
it doesn't persist or apply globally to embedded dashboards.
If you want your embedded dashboards to refresh at a fixed interval (like every
3 hours), the most practical workaround is to use external scripting in your UI
to reload the iframe that contains the dashboard. For example, you can use
JavaScript like:
```js
setInterval(() => {
const iframe = document.getElementById('superset-dashboard-iframe');
if (iframe) {
iframe.contentWindow.location.reload();
}
}, 3 * 60 * 60 * 1000); // 3 hours in milliseconds
```
This approach will force the embedded dashboard to reload at your desired
interval. Just be aware that this will reload the entire dashboard, which may
cause a brief flicker or loss of any unsaved state in the dashboard UI. There
is currently no supported way to trigger a "soft" refresh of just the charts
from outside the iframe.
For more details on how embedding works and why this limitation exists, see the
implementation of embedded dashboards in Superset's frontend code
([source](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/embedded/index.tsx)).
<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*
---
<sup>How did I do?
[Good](https://app.dosu.dev/response-feedback/0826787f-aaec-478a-aaae-1120f2902084?feedback_type=great_response)
|
[Irrelevant](https://app.dosu.dev/response-feedback/0826787f-aaec-478a-aaae-1120f2902084?feedback_type=irrelevant_answer)
|
[Incorrect](https://app.dosu.dev/response-feedback/0826787f-aaec-478a-aaae-1120f2902084?feedback_type=incorrect_sources)
|
[Verbose](https://app.dosu.dev/response-feedback/0826787f-aaec-478a-aaae-1120f2902084?feedback_type=too_verbose)
|
[Hallucination](https://app.dosu.dev/response-feedback/0826787f-aaec-478a-aaae-1120f2902084?feedback_type=hallucination)
| [Report
🐛](https://app.dosu.dev/response-feedback/0826787f-aaec-478a-aaae-1120f2902084?feedback_type=bug_report)
|
[Other](https://app.dosu.dev/response-feedback/0826787f-aaec-478a-aaae-1120f2902084?feedback_type=other)</sup> [](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github)&
nbsp;[](https://go.dosu.dev/discord-bot) [](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/discussions/34340)
GitHub link:
https://github.com/apache/superset/discussions/34340#discussioncomment-13903222
----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]