Forum Discussion

aaron's avatar
aaron
New Contributor
2 years ago

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!

No RepliesBe the first to reply