Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

UI Page Issue - How to access the data returned in Client Script in the Processing Script portion o

bpolo
Tera Guru

I have a UI Action on a Security Incident Form. The UI Action calls a UI Page. In the Client Script portion of the UI Page, we call a script include that does a REST Call. We want to access the results of the REST Call in the Processing Script portion of the UI Page. How would we be able to reference the results in the Processing Script  that are returned from the Script Include in the Client Script?

Thanks in advance! 

2 REPLIES 2

vinod39
Tera Contributor

To access the REST call results from a Script Include in the Processing Script of your UI Page, here's a simple approach:

 

Script Include: Make sure the Script Include does the REST call and returns the result.

Client Script (UI Page): Use GlideAjax to call the Script Include, get the REST call result, and pass it to the Processing Script.

Processing Script: Receive the result from the Client Script and use it in your Processing Script.

bpolo
Tera Guru

Thanks for your response. So my question is how do I reference the fields in my Processing Script.

So for example here is the  Client Script:

    function parseEntitle(answer) {
        g_form.addInfoMessage("Answer" + answer);
        return ;
 
Now I want to reference the answer field in Processing Script.
How do I write the script to reference the answer field in the Processing Script?
Thanks!