Category / Section
How to enable or disable Auto-Refresh option in JavaScript embedded dashboard?
Published:
In JavaScript embedding, we have the option to enable or disable the autoRefreshSettings
of the dashboard.
Follow these steps to enable or disable the auto-refresh feature:
- Locate the BoldBI.create() method in your JavaScript code. It should look similar to this:
this.dashboard = BoldBI.create({
serverUrl: rootUrl + "/" + siteIdentifier,
dashboardPath: "/Sales/Sales Analysis Dashboard",
embedContainerId: "dashboard",
embedType: BoldBI.EmbedType.Component,
environment: environment == "enterprise" ? BoldBI.Environment.Enterprise: BoldBI.Environment.Cloud,
width: '100%',
height: window.innerHeight + 'px',
expirationTime: 100000,
authorizationServer: {
url: authorizationServerUrl
}
});
-
Add the
autoRefreshSettings
member in the code. -
Set the
enabled
property ofautoRefreshSettings
totrue
. This will activate the auto-refresh functionality. Then add the propertyhourlySchedule
holds three more propertieshours
for an hourly refresh,minutes
for minute refresh, andseconds
for second refresh. By simply enablingautoRefreshSettings
refresh will be triggered every 30 seconds.
autoRefreshSettings: {
enabled: true,
hourlySchedule: {
hours: 1,
minutes: 10,
seconds: 30
}
}
- Save your changes and reload the dashboard. The auto-refresh feature should now be enabled.
- You can disable it by setting the property
autoRefreshSettings.enabled
tofalse
.
autoRefreshSettings: {
enabled: false
}
For more information on the Bold BI JavaScript API, refer to the official documentation.
Additional References