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 / Filter list by dropdow...
Power Apps
Answered

Filter list by dropdown and search box

(0) ShareShare
ReportReport
Posted on by 32

I have a gallery that has a dropdown filter and a search box and I'd like to be able to use both. I can get one or the other working, depending on the formula.

 

Search box (default)

SortByColumns(Filter(Trials, StartsWith(Title, TextSearchBox1_1.Text)), "Title", If(SortDescending1, Descending, Ascending))

Dropdown filter:

IF(Dropdown1.Selected.Value = "All Sites", Trials, Filter (Trials, Foundry.Value = Dropdown1.Selected.Value))

 

I'm having a hard time combining two formulas into one usable formula. I found some similar threads but couldn't apply them specifically to what I was going for.

 

Thank you

Categories:
I have the same question (0)
  • Verified answer
    tchin-nin Profile Picture
    779 on at

    Hi @Jensen

    You can try something like this to combined the 2 formulas :

    SortByColumns(Filter(Trials, StartsWith(Title, TextSearchBox1_1.Text) && (Dropdown1.Selected.Value="All sites" || Foundry.Value = Dropdown1.Selected.Value) ), "Title", If(SortDescending1, Descending, Ascending))

    If "All sitess" is selected, the second condition is true so no need to filter the Foundry.Value. 

    But if it's false, then the filter on foundry will operate. 

     

    Théo

  • Verified answer
    KroonOfficeSol Profile Picture
    587 on at

    @Jensen

     

    @tchin-nin is right, you should do it as he said.

     

    You could also do it like this (I find it easier to read):

    SortByColumns(
    	Filter(Trials, 
    		IsBlank(TextSearchBox1_1.Text) || StartsWith(Title, TextSearchBox1_1.Text),
    		Dropdown1.Selected.Value="All sites" || Foundry.Value = Dropdown1.Selected.Value
    	)
    	, "Title"
    	, If(SortDescending1, Descending, Ascending)
    )

    You could also drop the DropDown and change to a ComboBox. A combobox can be with no selection. The formula then becomes like:

    SortByColumns(
    	Filter(Trials, 
    		IsBlank(TextSearchBox1_1.Text) || StartsWith(Title, TextSearchBox1_1.Text),
    		IsBlank(ComboBox.Selected.Value) || Foundry.Value = ComboBox.Selected.Value
    	)
    	, "Title"
    	, If(SortDescending1, Descending, Ascending)
    )

    Hope this helps,

     

    Paul

  • Jensen Profile Picture
    32 on at

    These work great, thank you very much!

  • Jensen Profile Picture
    32 on at

    @KroonOfficeSol

     

    What would I need to add to get a second dropdown filter to work with this?

  • KroonOfficeSol Profile Picture
    587 on at

    @Jensen

     

    Just add a comma and an extra line like the other dropdown. This one

    Dropdown2.Selected.Value="All sites" || SecondField.Value = Dropdown2.Selected.Value


    You can add as many you like.

     

    Paul

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

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 366 Most Valuable Professional

#2
11manish Profile Picture

11manish 184

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 99 Super User 2026 Season 1

Last 30 days Overall leaderboard