- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2017 03:11 AM
Am getting response as below line,
"{\"Table\":[[\"Yes\"],null]}"
And it contains Yes, if Yes is present in response i need to do something, how to parse or split the response to identify Yes or No present in it?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2017 03:39 AM
Hi Swathi,
Here is the code. I have executed in background and value is coming as Yes
you can also test
var str = '{"Table":[["Yes"],null]}';
var parsed = new JSONParser();
var parsedData = parsed.parse(str);
gs.print('Value is:'+parsedData.Table[0]);
Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2017 06:30 AM
Hi Swathi,
Thanks for sharing the script. Is the value coming properly for the log of gs.log('data:'+parsedData.Table[0]);
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2017 06:40 AM
hi ankur,
I found out the bug...
The bug is with rest message....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2017 06:42 AM
Hi Swathi,
Great that you found the bug. So it should work now when you correct your Rest Message bug. Could you mark the answer as correct, helpful and hit like. Thanks in advance
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader