Rest Response error display_value=null

abhishek_verma1
Giga Contributor

Hi All,

While sending REST POST request, I am getting below response. If i am sending category parameter it is setting display value and creating record.

"error":{

"message": "java.lang.NullPointerException: null value in entry: display_value=null",

"detail": "null value in entry: display_value=null Check logs for error trace or enable glide.rest.debug property to verify REST request processing"

},

"status": "failure"

Could you please help me to resolve this issue.

Regards,

Abhishek Verma

6 REPLIES 6

Vikas-Malhotra
Mega Guru

Hi Abhishek,



Can you please check the response code as well ?



Regards,


Vikas Malhotra


Hi Vikas,



I have not written any response code... it is automatically generated... This is for scoped application(security incident)... when i am trying with global application (incident) , i am getting correct response..



Regards,


Abhishek verma


Hi Abhishek,


Can you run this script in the background script and let me know what is the response code that you see?



var request = new sn_ws.RESTMessageV2();


request.setEndpoint('https://<YOUR INSTANCE>.service-now.com/api/now/table/<TABLE NAME>');


request.setHttpMethod('POST');



//Eg. UserName="admin", Password="admin" for this code sample.


var user = 'admin';


var password = 'admin';



request.setBasicAuth(user,password);


request.setRequestHeader("Accept","application/json");




var response = request.execute();


gs.log(response.getBody());


gs.log(response.getStatusCode());


abhishek_verma1
Giga Contributor

Hi Vikas,



Thanks for the help, I found the issue. There are two fields on security incidnet and sm_order table with display value true. so it is overwriting the other value as we are not passing category so it is giving display_value=null.



Regards,


Abhishek verma