Forum Discussion
Hi that is great, never thought of that!
Sadly I keep getting an error.
My string is.
[
{
“response”:
{
“statusLine”:
{
“protoVersion”:
“HTTP/1.1”
“statusCode”:
200
“reasonPhrase”:
“OK”
}
“entity”:
“{“result”:{“status”:“success”,“message”:“Requested Item created: RITM1941111”,“record”:“RITM1941111”,“sysid”:“60f3d2eadbe7041001”,“automation_id”:null,“automation_version_id”:null}}”
My command is, jsonPath($,“$response.entity.status.record.sysid”)
“failure”: “Expecting object for JSON-Path field reference ‘status’, found: String”
Thanks for your help.
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
- peter6 years agoNew Contributor III
The error seems to be related to data type being returned.
- dimche_saveski6 years agoNew 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- peter6 years agoNew 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.
.