- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-12-2023 05:03 AM
Hi Community,
I have a ui builder page, and want to create a button which, upon click, executes an action and then reloads the page.
While I can get the 'executes and action' part done through the event scripts, I am not able to reload the page.
Any suggestions on how to achieve this?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2024 10:18 AM - edited ‎10-22-2024 04:47 AM
Hi @Hasan6
Though I would not personally recommend this method to update the data on the Page, as it can be refreshed through the definition of client states and data resources defined with dynamic inputs and event handler-triggers.
You can use the below script in order to reload the page by binding any event with the below client script -
Please note that you can access the document object using this code for other use cases as well.
Checkout full blog on this for more information on Pros and Cons.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-12-2023 05:10 AM
Hello @Hasan6
Follow the link to solve your query :-
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB1120645
Plz mark my solution as Accept, If you find it helpful.
Regards,
Samaksh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-12-2023 05:15 AM - edited ‎10-12-2023 05:20 AM
Hi Samaksh
This refreshes a list on the page, not the entire page.
Thanks for the quick response though.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-12-2023 05:11 AM
Hi @Hasan6,
I'm curious, why would you want to reload the entire page instead of only reloading contents of components which really need a reload?
What scripts have you already tried? I can suggest some things, but you may have already tried that.
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-12-2023 05:20 AM
Hi Peter,
I'm updating user language on click of the button, and will clear cache (gs.cacheFlush()) and then reload the entire page for the changes to take effect throughout.
I am not able to use the window.location.reload() in the scripts, as the object does not exist.