How to create a UI action which will open glidemodal popup and show some fields from the form

Amol Pawar
Tera Guru

Hi Experts,

I am seeking official ServiceNow documentation or video resources that explain how to configure a UI Action that launches a

GlideModal

, prepopulates fields with values from the current form, and includes both Submit and Cancel buttons.

 

Use Case Overview
I have a requirement to create a UI Action that triggers a Script Include. The Script Include updates a checkbox on the form, which in turn initiates a Flow. This Flow calls a Now Assist Skill and returns a JSON response that includes a value such as a Name. The Flow writes this JSON response to a form field called AI Response.

From this JSON response, I need to extract the Name value and display it within a GlideModal when the UI Action is executed.

Current Progress

  • The UI Action, Script Include, Flow, and GlideModal have all been created.
  • Clicking the UI Action successfully updates the checkbox, triggers the Flow, and writes the JSON response to the AI Response field.

Next Step Needed
I need guidance on how to read the Number value from the JSON stored in AI Response and display it in the GlideModal.
Additionally, the modal must include:

 

 

  • Name field (reference type), prepopulated with the value from the JSON response
  • A magnifying glass icon to browse values from the referenced table
  • Submit and Cancel buttons, allowing users to confirm or modify the Number before proceeding

If any additional details are required, please let me know.

Regards,
Amol

 

 

3 REPLIES 3

Ankur Bawiskar
Tera Patron

@Amol Pawar 

is this done in native and you created UI page for this?

are you saying you are looking on how to pass response from UI page to Modal to display some content?

share some screenshots

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi @Ankur Bawiskar,

 

Thank you for your quick reply.

Yes I want this to be done in native UI . 

AmolPawar_0-1770207556684.png

In above image, I want that Asset name to be populated on Modal.

AmolPawar_1-1770207633256.png

I need help in UI page HTML and Client Script. to populate that Asset field on the model with the prepopulated value and a string field like Notes. These notes should be added in work notes once the record is updated. One more requirement is if we click on Apply, it should change the state value to something else.

 

Regards,

Amol

@Amol Pawar 

so you want to pass value from form to UI page via UI action and also update the record

check this where I shared solution and then enhance

How to get pop up in ITSM Application 

to pass value of Asset to modal you can pass it using this

var asset = g_form.getDisplayBox('assetField').value;
dialog.setPreference('sysparm_asset', asset);

then in UI page render like this

<p>${sysparm_asset}</p>

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader