How to create a pop up modal in the Service Operations Workspace?

Badrul_A
ServiceNow Employee
ServiceNow Employee

I'm trying to create a pop up model in the Service Operations Workspace. My understanding is that a UI Page must first exist and you then reference that page in the code.

So ok for my test I'll choose to reference kb_and_language_popup though I have created a simple UI page of my own and got the same result as below.

 

In my UI Action code the moment I insert:

var dialog = new GlideModal('sn_km_gen_ai_kb_and_language_popup');
or
var dialog = new GlideModal('kb_and_language_popup');
 
I get the error message "Undefined". What is gong wrong?
2 REPLIES 2

Community Alums
Not applicable

To create a pop-up modal in the Service Operations Workspace, you can use the following syntax:

var ui_page_id = '<sys_id_of_your_ui_page>';
g_modal.showFrame({
    url: '/ui_page.do?sys_id=' + ui_page_id,
    title: 'Attachments',
    size: 'xl',
    height: 500
});

References

Badrul_A
ServiceNow Employee
ServiceNow Employee

Afraid that gives the same undefined error. 

// Name: kb_and_language_popup

// Sys ID: sn_km_gen_ai_kb_and_language_popup


var ui_page_id = 'sn_km_gen_ai_kb_and_language_popup';
g_modal.showFrame({
url: '/ui_page.do?sys_id=' + ui_page_id,
title: 'Attachments',
size: 'xl',
height: 500
});