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

Here in this Video, I have covered the Custom Application Pattern Troubleshooting and configuration Thank you for visiting my channel. Here, I'll share various technical knowledge. Feel free to reach out to me directly for any Service Now-related queries. Your support encourages me to consistently

SK Chand Basha
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

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

 

Here in this Video, I have covered the Custom Application Pattern Troubleshooting and configuration Thank you for visiting my channel. Here, I'll share various technical knowledge. Feel free to reach out to me directly for any Service Now-related queries. Your support encourages me to consistently

SK Chand Basha
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.