Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

Filtering with multiple criteria & fields...

Ok Pros, here's another one for you.  I have the following code and a screenshot of the screen....



If(Toggle1.Value,true,'Unit Class'.Value in colClass.Value),
If(Toggle1_1.Value,true,'Unit Class'.Value in colClass.Value),
If(Toggle1_2.Value,true, 'Unit Class'.Value in colClass.Value),
If(Toggle1_3.Value,true, 'Unit Class'.Value in colClass.Value),
If(Toggle1_4.Value,true, 'Unit Class'.Value in colClass.Value)),








I'm going cross eyed trying to get my code to allow everything above AND if the user wants to do a keyword Search() in the SearchBar on top of everything.  So far, as close as I've gotten is dropping an If() function in the mix but that only yields one aspect I'm looking for.  

Please and thanks team!

Super User II
Super User II

Hi @dpayne1022 

Without knowing if your formula works, since toggles are either true or false, you can drop the most of the If's and all  .Value.  Your formula distills to:


With({UCVincCV:'Unit Class'.Value in colClass.Value},
                    Toggle1_2, UCVincCV,
                    Toggle1_4, UCVincCV,
                       ), StartsWith(
                          ), StartsWith(
                                         LOCATION, Dropdown2.Selected.Value



Thank you for that. Much cleaner.  Also, can you break that down a bit. I'm not familiar with the syntax and format of With().   What variable is UCVincCV or are you declaring it at that instance? 

Super User II
Super User II


With() creates a very temporary variable available only within that formula. The variable can be an expression,a single value, a record or even a table and it has syntax like UpdateContext({...}). It has very minimal delay as well in execution. It wraps around the entire formula that it is used in. For a more detailed explanation and some examples see 

Thanks for responding Drrickryp! Any advice and help from you guys is excellent.  I did find out what was causing the issue.  I was using StartsWith() and I did not realize I could use the "in" operator so plainly (after I viewed the long list on  This yielded exactly what I was looking for.  

Thanks again!



If(Toggle1.Value,true,'Unit Class'.Value in colClass.Value,
Toggle1_1.Value,true,'Unit Class'.Value in colClass.Value,
Toggle1_2.Value,true, 'Unit Class'.Value in colClass.Value,
Toggle1_3.Value,true, 'Unit Class'.Value in colClass.Value,
Toggle1_4.Value,true, 'Unit Class'.Value in colClass.Value),
SearchBar.Text in Title,


Helpful resources

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users


We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Top Solution Authors
Top Kudoed Authors
Users online (67,598)