Forum Discussion
darshthakkar - My solution is pretty similar to what Abhishek_Soni37 provided.
I would recommend that you not use JSON.parse() for every record. It can be fairly taxing on your CPU depending on data volume. If you want to remove the hardcoded reference to the array of values to search for, I recommend you look at Expression Libraries.
Hope this helps!
- darshthakkar2 years agoValued Contributor
koryknick - If I use 2 filter snaps would that be more effective than using ["abc", "xyz"].filter(x=> $txt.contains(x)).length >=1?
- darshthakkar2 years agoValued Contributor
koryknick - CPU memory consumption as well as time taken to validate/execute the pipeline is pretty much the same with "abc", "xyz"].filter(x=> $txt.contains(x)).length >=1 as well as using 2 filter snaps.
There have been instances where using 2 filter snaps is faster than using the expression detailed above however if we have to scale the solution and there is a need to use 10 filter snaps that needs to filters out strings then the solution provided by koryknick would be helpful.Tried using expression library too however everytime the string needs to be updated, expression library needs to be updated and putting them into a filter snap instead is easier and convenient approach.
Thank you for your help koryknick and Abhishek_Soni37, closing this thread now.