Forum Discussion
Cool, I didn’t realize the JSON generator could be used like that. I got around it by initializing a counter variable at 0 and then adding a new mapper for each possible type of address (and incrementing the counter on each mapper), but the JSON generator will probably be cleaner.
Thanks!
@jskrable ,You can do the same in mapper snap too using expression builder. Here is the screenshot.
Expression:
[{
“address_type”: “mailing”,
“street_line_1”: $mailingAddress,
“city”: $mailingCity,
“state”: $mailingState,
“zip”: $mailingZip
},
{
“address_type”: “main”,
“street_line_1”: $mainAddress,
“city”: $mainCity,
“state”: $mainState,
“zip”: $mainZip
},
{
“address_type”: “shipping”,
“street_line_1”: $shippingAddress,
“city”: $shippingCity,
“state”: $shippingState,
“zip”: $shippingZip
}]
Result:
Hi Rakesh,
Pipeline parameter values are set to be as string literal, so in the not working the “”.concat(_Primary_Key) is basically just concatenating the “$Emp_ID, $Group_ID”
If you want you can instead use a different approach like split and join…
in your pipeline parameter set the object the you want to concat e.g. Emp_ID|Group_ID
then in the child pipeline you can do a split and join
_Primary_Key.split(‘|’).map((x) => $.get(x,‘’)).join()
hope this helps 🙂
- rakesh_20046 years agoNew Contributor
I used eval and it seems it will work. But documentation also says it will significantly impact performance. So any better way to do it?