- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2025 05:28 AM
Hi everyone,
I’ve built a custom heatmap for a dashboard using a client script + Script Include. The data is pulled via a GlideAjax call and then rendered into a heatmap table.
Currently, the heatmap only loads when I manually refresh the dashboard.
Here the ui widget that i use to load the ui page to to the widget:
Here’s a simplified version of my client script :
...... } catch (e) { // handle error } });
And the Script Include just aggregates some table data, groups it by two fields, and returns a JSON object.
Question:
What’s the best way to automatically reload or auto-refresh this heatmap data on the dashboard at a set interval (say every 30 seconds or 1 minute) without requiring a manual page refresh?
I want the dashboard to show the latest data continuously, but I’m not sure of the cleanest approach in ServiceNow (interval timers, using $scope.$broadcast, or another pattern).
Thanks in advance!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2025 05:47 AM
Hi @vkolokythas ,
To display the latest data continuously, you have a few options:
If you’re building the dashboard in Service Portal, use spUtil.recordWatch to auto-refresh the widget when underlying data changes.
Alternatively, consider using a Workspace instead of a dashboard, as Workspaces natively handle auto-refresh.
You can also explore the Dashboard Auto Refresh Widget available on the Developer site.
Thanks & Regards,
Muhammad Iftikhar
If my response helped, please mark it as the accepted solution so others can benefit as well.
Muhammad Iftikhar
If my response helped, please mark it as the accepted solution so others can benefit as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2025 05:47 AM
Hi @vkolokythas ,
To display the latest data continuously, you have a few options:
If you’re building the dashboard in Service Portal, use spUtil.recordWatch to auto-refresh the widget when underlying data changes.
Alternatively, consider using a Workspace instead of a dashboard, as Workspaces natively handle auto-refresh.
You can also explore the Dashboard Auto Refresh Widget available on the Developer site.
Thanks & Regards,
Muhammad Iftikhar
If my response helped, please mark it as the accepted solution so others can benefit as well.
Muhammad Iftikhar
If my response helped, please mark it as the accepted solution so others can benefit as well.