Forum Discussion
Which snap are you using to call it and how exactly are you configuring it?
Patrick,
Thanks for your response. I’m using a REST Post with service url, upload file, and headers defined (attached)
AC pdfcrowd test pipeline_2021_03_23.slp (9.0 KB)
I can share my account information if you need it
- tstack7 years agoFormer Employee
Are you expecting to process
$shoppingHistoryList.shoppingHistory
on its own or are you merging it with$input1_shoppingHistoryList.shoppingHistory
where each element in$shoppingHistoryList
corresponds to an element in$input1_shoppingHistoryList
?- GBekkanti7 years agoNew Contributor III
Thank you @tstack for the reply, I need to merge with
$input1_shoppingHistoryList.shoppingHistory
where each element in$shoppingHistoryList
corresponds to an element in$input1_shoppingHistoryList
but, the remaining fields in ‘$shoppingHistoryList.shoppingHistory’ should not be changed.- tstack7 years agoFormer Employee
You can do this with the expression language inside of a Mapper. For merging the arrays, you can use the
sl.zip()
function, like so:sl.zip($shoppingHistoryList.shoppingHistory, $input1_shoppingHistoryList.shoppingHistory)
The result of that expression will be an array of pairs containing the element from the first array and the corresponding element from the second array. Once they are grouped together, you can use a
map()
method on the array to iterate over the pairs and then useextend()
method to update the properties in the element from the first array with properties from the element in the second:sl.zip($shoppingHistoryList.shoppingHistory, $input1_shoppingHistoryList.shoppingHistory).map(x => x[0].extend(x[1]))
Here’s an example pipeline that does this mapping:
ReplaceFields_2018_12_16.slp (5.7 KB)
- aleung7 years agoContributor III
You can use replace expression to perform your conversion logic at ease but what is not clear is if you like to have this done dynamically, what exact mechanism would you like it to do? Based on the position of the array? or there are some other logic or fuzzy logic (less ideal)?
Related Content
- 7 years ago
- 6 years ago