- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2025 10:25 PM - edited 03-04-2025 10:27 PM
Hi,
Is it possible to run a modal after submitting a form in custom workspace? Some Example script will help. Also is it possible to redirect user to some other page using the modal?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2025 12:55 AM
why not open that in new tab so that form gets saved and the tab is also opened?
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
03-04-2025 10:33 PM
why to show modal during submission?
You can use onSubmit client script and use g_modal
you will multiple examples in OOB UI actions in workspace client script where g_modal is used.
you can refer those and create similar in your client script
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
03-04-2025 10:49 PM
Hi @Ankur Bawiskar ,
Actually I tried this but its working in the form but not working on the workspace. Also will I be able to redirect the user to some other page using this modal.
var gm = new GlideModal("glide_warn", true, 600);
gm.setTitle("Upload status");
gm.setPreference("title", "Your record is uploaded");
gm.setPreference("onPromptComplete", function() {alert("Ok")});
gm.render();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2025 10:52 PM
GlideModal won't work in workspace client scripts
you should be using g_modal
check this link
How to use UI Actions in Workspaces
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
03-04-2025 11:14 PM
Hi @Ankur Bawiskar ,
Will it be possible to use it in client scripts instead of UI action? My requirement is basically after the user submits a form in the workspace then a modal should show and have a button that will redirect them to a given url