How to have reference type input(User record) through GlideModal popup in servicenow UI action?

Manmaya Kumar S
Tera Expert

Hi,

I need to have the user record selected by the agent on the sc_task table. For this i want to have a UI action that would open a pop up and the needed user can be selected from there.

I want to use the GlideModal API for it, but I can't get any reference on the same as in how the ui pages would be designed as the UI pages used in the GlideModal instances at different places are not visible to us.

Any suggestion on this?



Thanks!

1 REPLY 1

RajC59005800307
Tera Guru

Hi @Manmaya Kumar S 

Your approach might be missing a proper setup of the UI Page as a modal dialog. If the UI Page isn't designed to accept and process parameters correctly or doesn't have the necessary client-side scripts to handle callbacks, the selected user value won't be passed back to your UI action. Also, ensure you're passing context information (like the sc_task sys_id) with setPreference() and that the page has the right access permissions. Without these, the modal may open but not function as intended.

 

e.g 

var gm = new GlideModal('your_ui_page_id');
gm.setPreference('sysparm_sc_task', g_form.getUniqueValue());
gm.render();
 

 

Kindly mark it correct and helpful if it is applicable.

Thanks,

Raj