cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
misc
Helper V
Helper V

Search/Filter gallery by dropdown choice

I'm creating a People Directory app which I have for the most part used the pre-made 3 page app, I am however having trouble with the search function, I think perhaps of the types of columns I'm using.

 

I would like to simplify the search by having a drop down where someone can choose whether they are searching by 'name', 'location', 'key skills' etc.

 

app.png

I can get the individual filters to work fine, but I can't seem to create the IF function to say 'IF dropdown is "Skills" then Filter by Skills, IF dropdown is "Name" then filter by Name etc.

 

I'm sure this is very simple but nothing I have tried seems to be working for me, as if I add an IF function then the entire gallery disappears as default.

 

FYI the Filter function I'm using is: 

Filter('People Directory', SearchBox.Text in 'Key Skills')

 

Alternatively, I'd be happy to just be able to search any of the fields without the use of the dropdown but again, nothing I was doing to make it search multiple columns worked.

 

FYI if it helps at all, my Name column is a People/Group column, Skills is multiple lines of text, and everything else is Single line of text.

 

I'm also using 'IN' because the list will never be over 500 lines long.

 

any help is greatly appreciated.

 

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@misc 

Consider this for your filter formula:

Filter(
    'People Directory', 
    Switch(yourDropdown.Selected.Value,
        "Skills", SearchBox.Text in 'Key Skills',
        "Name", SearchBox.Text in Name,
        "Location", SearchBox.Text in location
    )
)

I hope this is helpful for you. 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

2 REPLIES 2
RandyHayes
Super User
Super User

@misc 

Consider this for your filter formula:

Filter(
    'People Directory', 
    Switch(yourDropdown.Selected.Value,
        "Skills", SearchBox.Text in 'Key Skills',
        "Name", SearchBox.Text in Name,
        "Location", SearchBox.Text in location
    )
)

I hope this is helpful for you. 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

Thank you that works perfectly!

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power Apps Community Call Jan. 2022 768x460.png

Power Apps Community Call

Please join us on Wednesday, January 19th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (2,465)