how to add message to the screen using g_modal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
Hi,
How can I add message to the screen using g_modal but not g_modal.alert.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
yes g_modal should work
something like this
How to use UI Actions in Workspaces
g_modal.alert('My response');
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
this worked for me
Output
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
@Ankur Bawiskar i dont want that 'Alert' will apear, i want just the box
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
Yes you can , you can see below example:
Simple use-case: Script to group list by caller id and set row to 10 showing usage of g_modal
Workspace Testing:
Clicking the dialog box
After clicking Ok
Script for reference:
function onClick() {
// g_list IS GlideList
g_modal.confirm(
"Confirmation",
"Are you sure you want to sort the list by caller_id?",
function (ok) {
if (!ok)
return;
g_list.setRowsPerPage(10);
g_list.setGroupBy("caller_id");
g_list.refresh(1);
}
);
}
If you find this answer helpful, please mark the it as helpful/solution accepted:
Thanks and Regards,
Mohammed Zakir
