Hi all,
I'm trying to filter a collection based on multiple search items.
I have a text box where the user can enter multiple text values.
I can make a collection from those individual text items via Split, so that I have a collection with all the search values.
But then I want to filter a collection based on all those search values in a specific field.
E.g. when I enter "red flag" I want to return all records with "red" AND "flag" in a specific field.
Is that possible?
I tried a ForAll on all Split-items and add them one by one to a collection, but then I get all records with either "red" or "flag" in it.
Thank you for any solution.
Jack
Solved! Go to Solution.
Found a solution; RemoveIf.
That one works in a ForAll loop.
So I start with a complete collection and then remove all items that don't have the search string in it.
Hope someone else finds it usefull.
ClearCollect(
colZoekers;
Split(
txtZoek.Text;
" "
)
);;
ClearCollect(
colRes;
colPoeders
);;
ForAll(
colZoekers;
RemoveIf(
colRes;
!(Result in Intern)
)
)
Found a solution; RemoveIf.
That one works in a ForAll loop.
So I start with a complete collection and then remove all items that don't have the search string in it.
Hope someone else finds it usefull.
ClearCollect(
colZoekers;
Split(
txtZoek.Text;
" "
)
);;
ClearCollect(
colRes;
colPoeders
);;
ForAll(
colZoekers;
RemoveIf(
colRes;
!(Result in Intern)
)
)
User | Count |
---|---|
121 | |
88 | |
88 | |
75 | |
66 |
User | Count |
---|---|
217 | |
180 | |
138 | |
96 | |
73 |