cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Filter Array data

aakumar
New Contributor III

Hi all, below is the input data...

[
{
"items": [
{
"itemsFromPS": {
"tradeItems": [
{
"in": "003500",
"code": "CINC"
},
{
"in": "003622-B",
"code": "CINC"
},
{
"in": "003626",
"code": "CINC"
},
{
"in": "003700",
"code": "CINC"
},
{
"in": "009600-GRAD-R-5",
"code": "IRL"
},
{
"in": "030000",
"code": "CINC"
},
{
"in": "030000-S1",
"code": "CINC"
},
{
"in": "03015-BF",
"code": "CINC"
},
{
"in": "03020-BF",
"code": "CINC"
},
{
"in": "03060-BF",
"code": "CINC"
},
{
"in": "073706",
"code": "CINC"
},
{
"in": "073722-CD",
"code": "CINC"
},
{
"in": "073724-CD",
"code": "CINC"
},
{
"in": "073726-CD",
"code": "CINC"
},
{
"in": "073818",
"code": "CINC"
},
{
"in": "HLF-S940-SMA",
"code": "CINC"
}
]
}
}
],
"matchingItemNumber": [
"030000-S1",
"073722-CD",
"073724-CD",
"073726-CD",
"HLF-S940-SMA"
]
}
]

I need to fetch itemsFromPS.tradeItems.code  if the 

matchingItemNumber == itemsFromPS.tradeItems.in

how can I accomplish this ?

 

 

1 ACCEPTED SOLUTION

AleksandarAngel
Contributor III

Hello @aakumar,

Attached below is a sample pipeline that does the filtering by the matchingItemNumber.

You have two approaches included in it.

The first one uses just one expression in a Mapper Snap, and the other first splits the tradeItems and then filters out non matching items.

Please let me know if this helps you.

Regards,

Aleksandar.

View solution in original post

2 REPLIES 2

AleksandarAngel
Contributor III

Hello @aakumar,

Attached below is a sample pipeline that does the filtering by the matchingItemNumber.

You have two approaches included in it.

The first one uses just one expression in a Mapper Snap, and the other first splits the tradeItems and then filters out non matching items.

Please let me know if this helps you.

Regards,

Aleksandar.

aakumar
New Contributor III

Thank you very much. I had been racking my head to figure this out.....  Appreciate your help