Getting "undefined" value from REST Outbound Message

NehaSNOW
Tera Guru

Hi Members,

 

I am getting the "undefined" values from the Query Parameter of the REST Outbound message (refer the screenshot). But when the Parameter values are passed from the Endpoint then they are received properly e.g. https://<instanceid>service-now.com/api/918167/incident/create_incident?correlationid=${corrid}&shortdescription='${shortdesc}'.

Please suggest.

Release: Xanadu

 

The Scripted REST API is: - 

NehaSNOW_0-1739019002898.png

 

Query Parameter of the REST Outbound Message POST: -

NehaSNOW_1-1739019089918.png

 

Logs: - 

NehaSNOW_2-1739019136163.png

 

 

 

1 ACCEPTED SOLUTION

NehaSNOW
Tera Guru

I have fixed it by myself.

View solution in original post

11 REPLIES 11

@Natan F Rosa Actually, the parameters I am passing were not Query Parameters instead the Body content. Hence, the Request in the Scripted REST API will be: -

 

var requestBody = request.body;
var requestData = requestBody.data;
 
var corrid = requestData.correlationid;
var shortdesc = requestData.shortdescription;
 
Thanks,
Neha Pateria

BillMartin
Mega Sage

Hi @NehaSNOW ,

 

Sharing with you the integration best practices, giving you the ability to implement a reliable, scalable and fully functional REST-API calls using object oriented programming, SOLID priniciples, Service Oriented Architecture, Dependency Injection and the use of Circuit Breaker Pattern.

 

Dynamic Script Include and GlideAjax in ServiceNow: Scalable & Reusable Code for Architects

 

How to Call Third Party REST API Integrations in ServiceNow Using GlideAjax & Script Includes

 

Establish Reliability with ServiceNow API Integrations Using the Circuit Breaker Pattern