I'm a bit of a rookie at Mule 4 and have been trying to figure out how to map only the value from an array. My array is:
[
{
"ssn": "999999991",
"contributionCode": "1",
"amt": -100.000000
},
{
"ssn": "999999991",
"contributionCode": "2",
"amt": 1200.000000
}
]
What I need to do is filter the array by contributionCode and ssn and return only the amount value. I've tried this and variations of it but I only get errors:
vars.sumAmounts filter ($.ssn == '999999991' and $.contributionCode == '1' ) map -> ({$.amt})
So the output I'm trying to get from the above would be only -100.000000. Sorry in advance if this seems like a basic question but anyone's help would be very much appreciated.