Forum Discussion

vfantidou's avatar
vfantidou
New Contributor
2 years ago
Solved

Filter json array of objects by another json array of objects

Hello everyone, I have a json that looks like the bellow and I want to filter the $input0 data by whatever key/values exists in $filterData in the end. The $filterData may have ID or Customer (in th...
  • Supratim's avatar
    2 years ago

    vfantidou  Please use below expression-. From your example seems there are some typo (2nd record in input0 should have ID not ID_NUMERIC). If it's not typo you need make null safe in mapper.

    input0.filter((val,index)=> $filterData.find((ele)=> ele['ID'] ==val['ID'] ) != null )