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

dimche_saveski
New Contributor III

Try 2 separate mappings. First one jsonPath(dollarSign,โ€œ$response.entity.result.recordโ€)
and second one jsonPath(dollarSign,โ€œ$response.entity.result.sysidโ€)

Alternatively try these mappings
$response.entity.result.record
$response.entity.result.sysid

Regards
Dimche

peter
New Contributor III

The error seems to be related to data type being returned.

dimche_saveski
New Contributor III

Peter

That maybe the case because there are quotation marks just after entity and before result field name, that are making it into string. Please check if this is original response from Service Now, or you have edited and added quotation marks by mistake.

Regards
Dimche

peter
New Contributor III

I use a SQL select command to pull data from a table and a REST post command to create a task record in ServiceNow. The response contains the direct response. which I then wish to match to the SQL data so that I can update the SQL table.

image .

dimche_saveski
New Contributor III

Peter

I copied the response from above(just entity object), and mappings worked fine at my side. Can you please open your mapper and take screenshot so i can take closer look.