aaron
3 years agoNew Contributor
Conditional Mapping based on Value
Hi all!
Hoping someone could assist. My requirements is to map a specific email address from a list where type = "WORK". Example data:
{
"name": "xyz"
"country": "USA"
"emails": [
{
"emailaddress": "x@gmail.com",
"type": "WORK",
},
{
"emailaddress": "y@gmail.com",
"type": "HOME",
},
{
"emailaddress": "z@gmail.com",
"type": "PERSONAL",
}
]
}the output of mapper should be:
{
"name": "xyz" "country": "USA" "emailaddress": "x@gmail.com" }
I tried using ternary and a conditional snap but both didn't work so I probably got it wrong.
thanks in advance!