Array1 = [
{
"OrderId": "00111111",
"BillingCountry": "GB",
"CurrencyIsoCode": "GBP",
"PersonEmail": "[email protected]"
},
{
"OrderId": "00222222",
"BillingCountry": "US",
"CurrencyIsoCode": "USD",
"PersonEmail": "[email protected]"
}
]
Array2 = [
{
"SystemId": "00111111"
},
{
"SystemId": "00333333"
},
{
"SystemId": "00444444"
}
]
Output: [
{
"OrderId": "00222222",
"BillingCountry": "US",
"CurrencyIsoCode": "USD",
"PersonEmail": "[email protected]"
}
]
%dw 2.0
var Array2 = [
{
"SystemId": "00111111"
},
{
"SystemId": "00333333"
},
{
"SystemId": "00444444"
}
]
var Array1 = [
{
"OrderId": "00111111",
"BillingCountry": "GB",
"CurrencyIsoCode": "GBP",
"PersonEmail": "[email protected]"
},
{
"OrderId": "00222222",
"BillingCountry": "US",
"CurrencyIsoCode": "USD",
"PersonEmail": "[email protected]"
}
]
output application/json
---
Array1 filter ((item1) -> not ((Array2 map ((item) -> item.SystemId)) contains item1.OrderId))