cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RobHel
Frequent Visitor

Gallery with a Dropdown and Search Function

Hello,

 

Help required please - I've read every post I can find on this topic and still can't get it working correctly

 

I have a gallery with a dropdown box and search box - the only way I've managed to get them both working together is when a selection is made on Teacher, not searching on All Students.......This is what I have so far:

 

SortByColumns(Switch(Dropdown2.Selected.Value,"All Students", 'Student Details', Filter('Student Details', 'Teacher'.Email = User().Email, Searchbox.Text in Title || Searchbox. Text in Mobile || Searchbox.Text in Surname)), "Surname", Ascending) 

 

Appreciate any help on this one

1 ACCEPTED SOLUTION

Accepted Solutions

Ok thanks @RobHel ,'

The problem is guessing exactly what you need - you will want the searches to work even on "All Students"? Just move some  brackets as below and also allowed for blank search box

SortByColumns(
   Filter(
      'Student Details', 
      If(
         Dropdown2.Selected.Value = "All Students",
         true,
         'Teacher'.Email = User().Email
      ) &&
      If(
         IsBlank(SearchBox.Text),
         true,      
         Searchbox.Text in Title || 
         Searchbox.Text in Mobile || 
         Searchbox.Text in Surname
      )
   ), 
   "Surname", 
   Ascending
) 

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

View solution in original post

4 REPLIES 4
WarrenBelz
Super User
Super User

Hi @RobHel ,'

Try this

SortByColumns(
   Filter(
      'Student Details', 
      If(
         Dropdown2.Selected.Value = "All Students",
         true,
         'Teacher'.Email = User().Email &&
         (
            Searchbox.Text in Title || 
            Searchbox.Text in Mobile || 
            Searchbox.Text in Surname
         )
      )
   ), 
   "Surname", 
   Ascending
) 

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Thank you for such a fast response, I tried suggestion, unfortunately I am coming up with the same result with the search only working on the selected Teacher choice not All Students

Ok thanks @RobHel ,'

The problem is guessing exactly what you need - you will want the searches to work even on "All Students"? Just move some  brackets as below and also allowed for blank search box

SortByColumns(
   Filter(
      'Student Details', 
      If(
         Dropdown2.Selected.Value = "All Students",
         true,
         'Teacher'.Email = User().Email
      ) &&
      If(
         IsBlank(SearchBox.Text),
         true,      
         Searchbox.Text in Title || 
         Searchbox.Text in Mobile || 
         Searchbox.Text in Surname
      )
   ), 
   "Surname", 
   Ascending
) 

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

Perfect, just what I'm after - thank you kind sir

Helpful resources

Announcements
Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Government Carousel

New forum: GCC, GCCH, DoD - Federal App Makers (FAM)

In response to the unique and evolving requirements of the United States public sector, Microsoft has created Power Apps US Government.

Users online (3,975)