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
autoRefreshSettingsmember in the code. -
Set the
enabledproperty ofautoRefreshSettingstotrue. This will activate the auto-refresh functionality. Then add the propertyhourlyScheduleholds three more propertieshoursfor an hourly refresh,minutesfor minute refresh, andsecondsfor second refresh. By simply enablingautoRefreshSettingsrefresh 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.enabledtofalse.
autoRefreshSettings: {
enabled: false
}
For more information on the Bold BI JavaScript API, refer to the official documentation.
Additional References