Forum Discussion
Hello Peter,
It sounds like you may be referring to viewing the response during pipeline validation, is that correct? If so, the REST POST snap is set to only run during full execution by default. You can change that setting at the bottom of the snap with the “Snap Execution” drop-down field which is shown below in the screenshot. As a general rule all of our write-capable snaps with the purple icon are set to only execute on “Execute only.”
Super thank very much. That fixed it!
The data is returned in the following format;
"response": {statusLine:{, ...}, entity:{"result":{"status":"success","message":"Requested Item created: RITM1234569","record":"RITM1234569","sysid":"fb7f51d1dbaaaaaaa"}}, header...}
"original": {AutomationId:571, VersionNumber:2, Name:Get My Account, ShortDescription:Your account needs to be updated, SubmittedDate:{, ...}, url:Testurl2, type:Bot, Author:sveluswarm002, Inci...}
{response:{, ...}, original:{, ...}}
{response:{, ...}, original:{, ...}}
In order to extract the Record and sysid in mapper I use the following:
Record = $response.entity.slice($response.entity.search("record")+9,$response.entity.search("record")+20)
Sysid = $response.entity.slice($response.entity.search("sysid")+9,$response.entity.search("}}")-1)
Is that the best way to extract the data from the string?
Thanks for all your help today!
- dimche_saveski6 years agoNew Contributor III
Hello @peter
You can use JSON Path to get the Record and sysid in the mapper. Write the path to the sysid location, try this in the mapper jsonPath($, “$entity.result.sysid”).
Best Regards
Dimche SaveskiHi 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.
- dimche_saveski6 years agoNew 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.sysidRegards
Dimche