web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Search bar with dropdo...
Power Apps
Answered

Search bar with dropdown. Gallery uses If statement.

(0) ShareShare
ReportReport
Posted on by 52

Hello there!

 

I'm making an app which has a gallery that shows a numbers of items that are delegated into categories. However I have run into an issue. 

 

I had the search field working when I didn't need to have a blank item choice in the dropdown menu, however now that I do, the "If" Statement is occupied so to speak. 

 

I would like it to work like this: If anything is in the search field, it should filter the items in the gallery based on that, if not, filter it based on the dropdown.

Below is a PNG Attached explaining the different elements

 

Thanks in Advance! 

 

Regards

Tobias SQ Andersen 

 

PowerappExample.png
Categories:
  • v-yujincui-msft Profile Picture
    Microsoft Employee on at

    Hi @TobiasSQA ,

     

    Sorry, could you please provide your formula separately? The formula in your screenshot is not very clear.

     

    Best Regards,

    Charlie Choi

  • Verified answer
    v-yujincui-msft Profile Picture
    Microsoft Employee on at

    Hi @TobiasSQA ,

     

    Based on your description:  If anything is in the search field, it should filter the items in the gallery based on that, if not, filter it based on the dropdown.

    I have made a test for your reference.

     

    1. Here is my SharePoint List.

    vyujincuimsft_0-1651195236197.png

    2. Select the Gallery Control and try to apply the formula like this:

    If(
     !IsBlank(TextInput1.Text),
     Filter(
     datasource,
     TextInput1.Text in columnname
     ),
     If(
     !IsBlank(Dropdown1.Selected.Value),
     Filter(
     datasource,
     Dropdown1.Selected.Value = choicecoulumnname.Value
     ),
     datasource
     )
    )

    Result Screenshots:

    vyujincuimsft_3-1651196330451.png

     

    vyujincuimsft_2-1651196309085.png

    In addition, if you want the search bar and dropdown to work together, maybe you could try the following formula:

    Search(
     If(
     !IsBlank(Dropdown1.Selected.Value),
     Filter(
     datasource,
     Dropdown1.Selected.Value = choicecolumnname.Value
     ),
     datasource
     ),
     TextInput1.Text,
     "columnname"
    )

    Result Screenshot:

    vyujincuimsft_4-1651197088069.png

     

     

    Best Regards,

    Charlie Choi

     

     

  • TobiasSQA Profile Picture
    52 on at

    Hey Charlie

     

    Once again this worked perfectly, thank you so much for the stellar assistance! You're almost doing too much 🙏

     

    Kind Regards,

    TobiasSQA

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 405 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 368

#3
WarrenBelz Profile Picture

WarrenBelz 244 Most Valuable Professional

Last 30 days Overall leaderboard