03-13-2020 03:20 AM
Hi
I have a pipeline which takes data from a SQL select command and posts to a Service Now API to create a task. Service Now responds with the ID’s of the tasks which I want to post back to the SQL.
However when I run the POST command in Snaplogic, I seem to get no response back, the circle is blank. I know the API has worked as I can see the tasks in Service Now and If I run the API command in Postman, I get the ID’s returned.
How do I see the JSON response from the REST POST Snap?
03-18-2020 03:03 AM
Thanks for your continued help!
and the output from the SNoW API is
My second issue is that the SNoW API POST Response returns three vales as numeric, but the response string shows them as NULL.
03-18-2020 03:28 AM
Peter
The mapping you have currently in the mapper is wrong, its trying to access object with name status , but status is a string . Delete that line and try this one instead:
$response.entity.result.sysid
Copy the line and try it, it should work.
03-18-2020 03:35 AM
The following gives me the string
However $response.entity.result.sysid fails
03-18-2020 05:22 AM
Peter
The problem is that entity object is a string, it should be JSON instead. I removed the quotation marks manually( the ones that are wrapping entity field value) and it worked instantly. Try JSON.parse($response.entity) function… That should make string into json
03-18-2020 05:36 AM
I nope get a a pair of red returned with no data.