Here is a cool search filter using Regular Expressions that is probably more of what you’re looking for: Hack to filter lots of data
I made a “Playground” doc where I have examples of cool strategies I’ve seen on the forum and this search strategy is one of them. You can check it out here:
I changed the sheet up a bit. Now there’s also a dropdown. The behaviour I want to achieve:
If the dropdown is selected, show me what matches the dropdown.
If there’s something in the search box, show me those rows as well
If there’s nothing in the dropdown, or the search box, show me everything
Right now, if something is searched, and the dropdown is selected, it works.
If theres only something in the search, it works
If there’s only something in the dropdown, it fails
@mallika I made some screenshots below… for some reason I can’t change the share permission on the documents. Not sure if people can see / play with the embedded example.
@Karim_Noseir - This is most likely due to the Value in the dropdown and the Category not being the same type. Can you make a copy of the doc and share it with me. Else I’d like to see what the dropdown formula is ( how it is populated) and same for Category. Thanks!
@mallika Did you guys fix a bug or something? It started working with the same formula now.
EDIT: now it’s stopped working again?? Not sure what’s going on.
EDIT 2: it’s got to be something with the regex string returning some weird value when the search box is empty causing it to break the rest. if you add one ‘spacebar’ character to the search box it works:
For those coming to this thread later for a solution:
If searchbox is empty, it returns true, so it was matching ALL rows regardless of what the dropdown was selecting, making it look like the dropdown wasn’t working.
Solution was the following formula with an if statement to account for an empty search box:
If(Search.[Search Box].First().IsBlank(), Matches(Category,categoryFilter), Matches(Category,categoryFilter ) OR RegexMatch(Text,Search.[Search Box].First()))