Confirmation box on ui action on list view
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-27-2024 02:39 AM
Hi All, I have requirement to show pop up message when user clicks on UI action. Confirmation box is working fine on form view. On list view it is not working. Can someone please let me know the code or solutions to populate confirmation pop on list view when user clicks on UI action? Thanks in advance.
Thanks,
Tara Singh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-27-2024 02:46 AM
Hi @Tarasingh26
Could you please share what code you written and what it is doing to help you.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-27-2024 02:59 AM
Hi @Tarasingh26 ,
you could use the GlideModal client api on your ui action client script to open a ui page as a modal which contains an ok and a cancel button.
By clicking cancel, the modal vanishes. By clicking ok, the processing script of the ui page is executed. The processing script should also contain some type of redirect. This should work on form and list view.
Ui action code
function openConfirmModal() {
var modal = new GlideModal('my_confirm_modal');
modal.setTitle('Confirmation');
modal.render();
}
UI page html code
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g:ui_form>
<p>Do you want to confirm?</p>
<g:dialog_buttons_ok_cancel ok="return true" />
</g:ui_form>
</j:jelly>
In the processing script of the ui action you could have something like this for the redirect:
response.sendRedirect(gs.getUrlOnStack());
Example for List ui action on incident table
I hope this helps!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-27-2024 03:01 AM
In the example the name of the ui page is "my_confirm_modal" and everything is in the global scope. In a scoped app the scope prefix has to be added to the name of the ui page, when calling GlideModal.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-02-2025 10:50 AM
Maybe also have a look at @Mark Stanger s Code:
https://servicenowguru.com/client-scripts-scripting/javascript-popup-boxes-servicenow/
I have a feeling that this might be enough for your Use Case.
If this answer was helpful, I would appreciate if you marked it as such - thanks!
Best
Daniel