Need to show the particular fields in the response message instead of all the JSON message.

SaitejaN
Tera Contributor

I have built outbound integration using REST Messages, and the HTTPS status is 200. It's perfect, but I need a particular field to show up in the response. How can I do that?

2 ACCEPTED SOLUTIONS

Runjay Patel
Giga Sage

Hi @SaitejaN ,

 

you can use code like below to get the field value from response.

In your rest message set response type as JSON/Application

var response = responseObject.getBody();
var responseJson = JSON.parse(response);
var shortDescription = responseJson.field_name;

 

-------------------------------------------------------------------------

If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.


Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay

-------------------------------------------------------------------------

 

View solution in original post

In this video i have explained about Web service integration in ServiceNow like how it works, how we can configure it, what are the prerequisite and many more. I have covered below topics in this video. 1. understand Web Service. Like when and how we will use it. 2. Talked about Inbound and ...

SK Chand Basha
Tera Sage
Tera Sage

Hi @SaitejaN 

 

Use any multi text fields like Description, Short Description or create a custom field with the below script provided by Runjay .

 

https://www.servicenow.com/community/developer-articles/remote-table-use-case-to-show-weather-detail...

Mark it Helpful and Accept Solution!! If this helps you to understand.

View solution in original post

2 REPLIES 2

Runjay Patel
Giga Sage

Hi @SaitejaN ,

 

you can use code like below to get the field value from response.

In your rest message set response type as JSON/Application

var response = responseObject.getBody();
var responseJson = JSON.parse(response);
var shortDescription = responseJson.field_name;

 

-------------------------------------------------------------------------

If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.


Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay

-------------------------------------------------------------------------

 

In this video i have explained about Web service integration in ServiceNow like how it works, how we can configure it, what are the prerequisite and many more. I have covered below topics in this video. 1. understand Web Service. Like when and how we will use it. 2. Talked about Inbound and ...

SK Chand Basha
Tera Sage
Tera Sage

Hi @SaitejaN 

 

Use any multi text fields like Description, Short Description or create a custom field with the below script provided by Runjay .

 

https://www.servicenow.com/community/developer-articles/remote-table-use-case-to-show-weather-detail...

Mark it Helpful and Accept Solution!! If this helps you to understand.