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.

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

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

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

 

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.