Does anyone know how to pass a value from a UI Page back to a UI Action before running more code afterwards?

Avery Brown
Tera Contributor

Hello, I have a requirement to create popup confirm window with a hyperlink that will be triggered from a UI Action. I've accomplished creating the UI Page. Now where I'm having a problem, is there additional code in the UI Action that needs to run based on the user confirming the first popup window. 

Currently, when the button is clicked, the DialogWindow opens, and the rest of the code runs automatically at the same time. (Which subsequently will open a second dialog window over the first.)

find_real_file.png

1 ACCEPTED SOLUTION

Frank Tate
Giga Guru
Giga Guru

Here's a previous post on a very similar topic. It uses GlideModal() and renderWithContent() to achieve a very similar goal (with a bonus of having all of the HTML for the GlideModal dialog in the script itself, without having to create a separate page).

Frank

View solution in original post

8 REPLIES 8

Thank you! This worked perfectly!

@Avery Brown 

I think the option would work when the HTML content is less.

I don't think this solution is feasible if the HTML content is huge enough.

Did you check my earlier response with the approach?

Regards
Ankur

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

Hi @Frank Tate ,

I have similar issue, How to get return value from UI Page, Kindly help me with you inputs 

https://www.servicenow.com/community/developer-forum/how-to-use-ui-page-in-onsubmit-client-script/td...

Supriya25
Tera Guru

Hi ,

CAn you help me on my issue please. I have same use case.

https://www.servicenow.com/community/developer-forum/how-to-use-ui-page-in-onsubmit-client-script/td...

 

Kindly help me