cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Obtaining response from JSON Post command

peter
New Contributor III

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?

22 REPLIES 22

peter
New Contributor III

Thanks for your continued help!
image

and the output from the SNoW API is
image

My second issue is that the SNoW API POST Response returns three vales as numeric, but the response string shows them as NULL.

dimche_saveski
New Contributor III

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.

peter
New Contributor III

The following gives me the string
image

However $response.entity.result.sysid fails

image

dimche_saveski
New Contributor III

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

peter
New Contributor III

I nope get a a pair of red returned with no data.