Glide AJAX not working

umaaggarwal
Giga Guru
Giga Guru

Hello Experts,

My goal is to have a string field on incident form and when the form loads, it should get populated with CI details ( like name , manufacturer , asset tag etc ) based on what is selected under configuration item.

To achieve this, I created onload client script, and using glideajax to interact with script include which returns the data from that specific configuration item, however I am getting null value as a result. Can someone please help ?

 

Below is the client script 

 

find_real_file.png

script include 

 

find_real_file.png

 

Output 😞

 

find_real_file.png

 

 

17 REPLIES 17

Jim Coyne
Kilo Patron

Did you find a solution to your issue? If yes, please remember to tag the correct answer and any that were helpful.

Gosia Urbanska
Giga Guru

Are you getting your gs.log ?

few tips for debugging:

1. check your connection between client script and Server side

add gs.log as you did but remember second parameter is a string 

comment out the rest of function

2. if #1 ok, move to check parameters

add gs.log after this.getParameter

3. if #2 ok, change your gr.get(SYSYID) to

gr.addQuery('sys_id',SYSID);

gr.query();

if(gr.next()){

//your code

// result = ???

}

return result;

Sometime the "get " doesn't work as expected

Amit Jain2
ServiceNow Employee
ServiceNow Employee

Not sure if any of the solutions worked. But another thing to ensure is that you need to give the execute access to your client callable script include by creating an ACL for 'client_callable_script_include'. There you need to provide relevant roles to it about the users who are going to call your glide ajax function.