โ10-27-2020 02:28 PM
In a mapper snap, my current expression is:
$[โenv:Envelopeโ][โenv:Bodyโ][โns0:uploadFileToUcmResponseโ].result[โ$โ]
I only want the second value โ123109โ returned as a string. How can I do this? Thanks!
โ10-27-2020 10:31 PM
@swright array[1] , it will give you 2nd value. for your case it looks like-
[โenv:Envelopeโ][โenv:Bodyโ][โns0:uploadFileToUcmResponseโ].result[โ$โ][1]
or
[โenv:Envelopeโ][โenv:Bodyโ][โns0:uploadFileToUcmResponseโ].result[1]
โ10-28-2020 04:56 AM
I had tried these before and I think that they should have worked but they didnโt.
The first one changed the values to 1 and 2 which isnโt what I want:
$[โenv:Envelopeโ][โenv:Bodyโ][โns0:uploadFileToUcmResponseโ].result[โ$โ][1]
The second one failed with:
reason":
โโ1โ was not found while evaluating the sub-expression โ$[โenv:Envelopeโ][โenv:Bodyโ][โns0:uploadFileToUcmResponseโ].result[1]โโ
I also tried the following that failed:
$[โenv:Envelopeโ][โenv:Bodyโ][โns0:uploadFileToUcmResponseโ].result[โ$โ].pop()
It failed with:
"String type does not have a method named: pop, found in: โฆsult[โ$โ].pop().
Thanks,
Scott
โ10-28-2020 09:16 AM
@swright Is that possible to share sample json here?
โ10-28-2020 02:01 PM
I attached a copy of the json.
I am currently using a fix for the issue in which I use a filter snap after the mapper. It works, but I think that I should be able to select from the values in the mapper and not have to use the filter. Although it looked to me like an array, it seems to be a string which is why many of the things I tried didnโt work.
Thanks,
Scott
(Attachment Copy_output0.json is missing)