cancel
Showing results for 
Search instead for 
Did you mean: 

Filter the data

swatifunde
Contributor

Hello Community,

Below is input
[
{
“name”=“ABC”
“ID”=“D.0012”
},
{
“name”=“XYZ”
“ID”=“B.002”
},
{
“name”=“OPQ”
“ID”=“E.0012”
},
{
“name”=“LMN”
“ID”=“J.0012”
},
{
“name”=“DEF”
“ID”=“C.0012”
},
{
“name”=“RST”
“ID”=“B.05”
}
]

I have millions of records like this , I want to filter them based upon one key named as “ID”: and need the data for only the object which have “J.” or “C.” and discard all the rest ID

1 ACCEPTED SOLUTION

darshthakkar
Valued Contributor

@swatifunde - The simplest approach is to use a filter snap and put a condition of startsWith either J or C. Snap below:

image

Would the ID be always in the format of “Letter.(number)(number)(number)(number)”?
If yes, you can use the above-mentioned approach. Also, if you’re expecting ID to be Null/blank and want them to pass, please do select “Null-safe access”.

Regards,
Darsh

View solution in original post

3 REPLIES 3

darshthakkar
Valued Contributor

@swatifunde - The simplest approach is to use a filter snap and put a condition of startsWith either J or C. Snap below:

image

Would the ID be always in the format of “Letter.(number)(number)(number)(number)”?
If yes, you can use the above-mentioned approach. Also, if you’re expecting ID to be Null/blank and want them to pass, please do select “Null-safe access”.

Regards,
Darsh

Or you can also use match… e.g.

sl.ensureArray($ID.match(/J|C/g)).length > 0

Its working as expected, Thank you so much 🙂