The CreatorCon Call for Content is officially open! Get started here.

Retrieve value from Response.getBody() in JSON

manish123
Giga Guru

Hi All,

In REST integration, we are getting Response.getBody() with lots of fields and values respective to it. However, i would like to get some specific value from that Response.Could anyone please let me know how to get that? I tried with decode and Parse but still in log its displaying undefined.

1 ACCEPTED SOLUTION

Result does not appear to be an array. I'm reaching this as:



gs.log('Number=' + jsonObject.result.number);


View solution in original post

42 REPLIES 42

Hi Chuki,

 

Please you please provide clear syntax for setting dynamic sys_id in End point for PUT method

If below is the URL https://instanceb.service-now.com/api/now/table/incident/${incident_id}

 

then how to set value in incident_id. need to know how to SetParamenter with in Business Rule

manish123
Giga Guru

Hi Chuck,



We have configured web services between two SN instances and through this integration we are creating incident from instance A to another instance B. And Updating incidents to both sides. These parts are working perfectly.



However now the issue is for the configuration of attachments.   And it should be from both sides during update. So, whenever any file is attached in instance A while raising the incident, the same would need to pass to other instance i.e. B's incident. Also after creation of incident if any file will get attached then the same to be passed to other instance and this part will be vice versa, means from instance A to B and instance B to A.



Could you please share the steps from starting or any URL from where I'll explore and do the proper setup for attachment in JSON.



Any help will be much appreciated.


To do this you need to use the REST Attachment API. It is very similar to the table or attachment API that you are already using. Be aware that there are limitations on the file size that it will transfer.



Attachment API


Hi Chuck,



Is there a way we can get the schema as response from json?



Thanks,


Sivaranjani


Hi Sivaranjani,



Can you help me understand what the requirement/use case is? ...and the schema to what? The entire database schema?