Forum Discussion
@vaidyarm if you want to post a file, you have to save that file (most relevant option is sldb). Then use below setting and delete that file after processing.
Whatever option you might looking for , that can be post as http entity.
Your solution had worked fine as long as we pick up files from SLDB to post via the rest post API,
it would be great if can have a way to directly send files using the above snap, without having to write first on SLDB.
Thanks
Rahul
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.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)
Related Content
- 11 months ago
- 2 years ago