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

I tried with


gs.log('REST data parsed: ' + jsonObject.result[0].number ); But still getting as undefined.


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



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


Thanks, Chuck. Just tried that and it worked.



Cheers, mate!!!


Hi Chuck,



Now, I am planning to update Incident work notes. So, if work notes updated in one instance it will pass to other instance incident. Could you please let me know what needs to do?


The work notes should be in that same JSON object. Similar procedure. Get the work_notes from the JSON object and save them in the target record.