- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2020 03:15 AM
Hi Guys,
We have scripted rest API which gets the request from another API. we have to update this request in a field in a table. I am able to get the request details & i can see the request body by capturing in the logs but when i am trying to set the same body to the concerned field in the required table , i couldn't do so, it's empty. (pls see the screen shots for reference).
I need that request body to be updated to the particular field . Any help on this please ?
Solved! Go to Solution.
- Labels:
-
Integrations
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2020 04:32 PM
as discussed over hangout , we solved it with below line.
var parser = new JSON();
var obj = parser.decode(ab);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2020 03:20 AM
you have to parse the json and then set the value to corresponding column on your script.
refer the doc link for further details.
https://developer.servicenow.com/app.do#!/api_doc?v=london&id=r_JSON-parse_S
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2020 04:19 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2020 04:24 AM
just comment that line
quick question, what are you getting in variable jobID, put the log and share here.
also paste the json log details, if possible.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2020 04:51 AM