Forum Discussion

akarsh's avatar
akarsh
New Contributor III
2 years ago
Solved

Filter Single attribute from JSON list to use it in a like query

My Input looks like this.  { "totalCount": 4, "dataList": [ { "IfaNumber": "1", "alink": "", "agroupId": "" }, { "IfaNumber": "2", "alink": "", "agroupId": "" }, { "IfaNumber": "3", "...
  • Aleksandar_A's avatar
    2 years ago

    Hello akarsh,

    You can try with the following expression in a Mapper Snap:

    $dataList.map(x => x.IfaNumber).filter((x,ind,arr) => arr.indexOf(x) == ind)

    This expression, first maps only the IfaNumber values from the dataList array, then filters out the duplicates.

    Attaching the sample pipeline below.

     

    Let me know if this helps you!

    Regards,

    Aleksandar.