- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2024 01:07 PM
I have several single scores on a homepage as well as a refresh button. I am wanting to refresh all of the single score components when this button is clicked. Any ideas on how to achieve this?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2024 06:21 AM
The data visualization components have a property called Refresh requested you can use to refresh the component. The steps would be in UIB:
- Create a client state parameter called something like refreshRequested and set it to an empty string
- Bind that CSP to the Refresh requested property on all data vis and list components (single score is a data vis component) you want to refresh.
- Write a client script that sets the value of the refreshRequested:
api.setState('refreshRequested', {timestamp: Date.now()})
- Trigger that client script from your button.
There's an old video of me using this method to trigger a refresh on a list in the last video on this post: https://developer.servicenow.com/blog.do?p=/post/quebec-ui-builder-lists/

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2024 06:21 AM
The data visualization components have a property called Refresh requested you can use to refresh the component. The steps would be in UIB:
- Create a client state parameter called something like refreshRequested and set it to an empty string
- Bind that CSP to the Refresh requested property on all data vis and list components (single score is a data vis component) you want to refresh.
- Write a client script that sets the value of the refreshRequested:
api.setState('refreshRequested', {timestamp: Date.now()})
- Trigger that client script from your button.
There's an old video of me using this method to trigger a refresh on a list in the last video on this post: https://developer.servicenow.com/blog.do?p=/post/quebec-ui-builder-lists/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2024 06:25 AM
Brad,
Thanks for the fast reply, however I do not see the refresh requested property on my single score component, where can I find this property so that I can bind the CSP?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2024 06:54 AM
It looks like that property may have been added in Washington. Which release are you on?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2024 07:09 AM
Brad,
Thanks for the reply! Currently on Vancouver but will be upgrading to Washington soon. Until then I will probably use the real time update to keep those scores up to date in real time. Are you aware of any performance issues with using that for multiple scores?