- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-22-2015 12:25 AM
Hi,
I create a business rule for a Rest call to get a json response.Now I am trying to parse it using JSONParser but it is not working for me.
I am trying :
var response = r.execute();
var responseBody = response.getBody(); //JSON response
var parser = new JSONParser();
var parsed = parser.parse(responseBody);
gs.info("parsed response:" + parsed);
But this way of parsing is not happening.Am I missing something here.Please let me know
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-22-2015 03:32 AM
Thank you Rahul.
It works with global keyword as described in FujiForty - What Happened to JSONParser? — CAVUCode
var parser = new global.JSON();
var parsed = parser.decode(responseBody);
Cheers

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-22-2015 12:41 AM
Try Below and see if it works
var parser = new JSON();
var parsed = parser.decode(responseBody);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-22-2015 03:32 AM
Thank you Rahul.
It works with global keyword as described in FujiForty - What Happened to JSONParser? — CAVUCode
var parser = new global.JSON();
var parsed = parser.decode(responseBody);
Cheers