custom Pop up message
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2025 10:13 PM
Hi there,
I have a requirement based on the variable selected in the record producer. We need to populate the pop up message which should have 4 buttons upon selection we have to redirect to a specific form in the portal.
What is the best way and how can we achieve this ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2025 11:47 PM
so they want 4 buttons and each button will take them to some other URL?
If yes then do something like this but please enhance to show other 3 buttons and write that in onChange catalog client script
Form the complete HTML string and put in HTML variable below
Script:
var html = '<a href="https://www.w3schools.com" target="_blank">Visit W3Schools.com!</a>';
// Use spModal to pop the HTML
if (html) {
spModal.open({
title: 'My Confirm Box',
message: html,
buttons: [{
label: 'OK',
primary: true
}],
});
}
Output:
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2025 07:24 PM - edited 06-05-2025 07:25 PM
Thanks for the efforts it is working fine but the thing is on click of the buttons I need to redirect to the form and the form values to be copies as well. 3buttons 3 different forms and fourth button will be cancel button which stays on the same/current page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2025 08:20 PM
I just shared a sample script and you can enhance it further to show buttons.
Since you want form value/variables to be copied, you will have to include them in URL as parameter and then write onLoad client script on respective forms to get the values from URL and set on the varaiables/forms
check these links on how it can be done
How we can set the variables on catalog item form from UI action. (recommended)
Redirect from a UI Action to a Catalog Item and set default values
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2025 10:24 PM
Hi @Ankur Bawiskar
Currently I can redirect the users using the spmodel like below
Instead of thsi can we populate similar to cancel button once we click on those button it should redirect to the forms ?
3 buttons for 3 forms 4th button will be a cancel button if user clicks on that he/she will stay on the same/current page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2025 10:31 PM
I already shared sample example logic, you need to enhance it as per your requirement.
how you can send values in URL and how to get, I already shared links for that above.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader