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:
- jskrable9 years agoNew Contributor III
Thanks! This was very helpful. Seems cleaner to do all this inside a mapper.