UI Builder: Refresh List
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-27-2021 02:13 AM
Hi everyone,
I'm using UI Builder to display / update a list on a page. I have a button that submits new information to an already existing record. I'm trying to update the list automatically after the information has been submitted, but I can't quite get it right. I'm using this script:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-29-2022 01:39 AM
For others looking for the answer. Here is how it worked for me.
1. Create a client state parameter. For ex. refreshReq
2. Create a page script. Use below code in that.
ServiceNow Community Rising Star 2022/2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-29-2022 02:14 AM
However, I noticed that the list is refreshed on second click of button. Did anyone manage to solve this?
ServiceNow Community Rising Star 2022/2023

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-17-2022 02:32 PM
I know that this is an old question, but it was one of the top search results so I wanted to update with the correct answer.
Brad Tilton has a video on the topic, but the way you refresh a list is how you do almost anything else in this reactive framework--by updating a state parameter.
There is a property called "Refresh Requested" on the List which you bind to a state parameter such as "listRefreshRequested". In earlier versions you set it to an object value using a client script {"timestamp": Date.now()} but in more recent versions (e.g. Tokyo) you can just set it to "Date.now()" and it will initiate a refresh.
function handler({api, event, helpers, imports}) {
api.setState("listRefreshRequested", Date.now());
}
// In earlier versions you may need to do this:
function handler({api, event, helpers, imports}) {
api.setState("listRefreshRequested", {"timestamp" : Date.now()});
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-07-2023 10:09 AM
What about if I don't want to update the list but update another component like the Dropdown list?
Say I have a multi select dropdown list of 10 groups which when selected updates the filter on a list component, then the user removes the groups in the filter on the list component. How do I remove the checkboxes from the groups on the multi select dropdown?
robert_fauver@cable.comcast.com or robertfauver@gmail.com