Forum Discussion
dimitri_hristov
6 years agoContributor
Hi @vaidyarm,
I’ve put together a pipeline where I simulate your case. In it I propose two solutions. Assuming that the $olditem array is anywhere in the hierarchy of the input document:
- If you put
jsonPath($,"$..olditem")[0].map(x=>{"row":x.id})
in an Expression in a Mapper, and assign it to $batch Target Path, you should get the output you described. - The second solution has 2 Mapper Snaps. In the first one, I extract $olditem from anywhere in the hierarchy and assign it to $batch. In the second Mapper, i designate
$batch[*]
as Mapping Root, and I proceed to remap the array elements.
Here’s the pipeline:
Array_key_value_pair_2020_07_01.slp (9.0 KB)
BR,
Dimitri
Hi,
Long time ago, I encountered this also.
If I remember well, it was due to the space in the right path header name.
I don’t remember if you also should remove the space in the left path header but you may want to remove it also.You should use a mapper for each of your csv file and rename this two columns.
Give it a try and let us know!