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 / Filtering gallery with...
Power Apps
Answered

Filtering gallery with multiple filters

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

 

My app should allow users to filter the gallery 3 ways: 

1. By Status from dropdown

2. Search input box

3. Sort gallery by priority 

 

sonia909_0-1658445173059.png

 

This is my current code:

 

If(StatusDropdown.Selected.Value = "All" && IsBlank(SearchBox.Text),
SortByColumns(DataSource, SortColumn,If(SortDecending,Ascending,Descending)), //SortColumn variable set on sort icon
Filter(Datasource, SearchBox.Text in Title || Status.Value = StatusDropdown.Selected.Value))

 

Problem: The problem I'm facing here is that it does everything except filter by other options from the status dropdown.

 

Any assistance is highly appreciated! Thank you

 

Categories:
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @Anonymous 

    SortByColumns(
     If(
     StatusDropdown.Selected.Value = "All" && IsBlank(SearchBox.Text),Datasource,
     Filter(
     Datasource,
     Status.Value=StatusDropdown.Selected.Value || Title in TextInput1.Text
     )
     ),If(SortDecending,Ascending,Descending)
    )
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @Drrickryp 

    I tried the code above and the gallery is empty. I added SortColumn variable to it, which shows the gallery but the search feature is not functioning. 

    SortByColumns(
     If(
     StatusDropdown.Selected.Value = "All" && IsBlank(SearchBox.Text),Datasource,
     Filter(
     Datasource,
     Status.Value=StatusDropdown.Selected.Value || Title in TextInput1.Text
     )
     ), SORTCOLUMN, If(SortDecending,Ascending,Descending)
    )

     

    Thank you for your help!

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @RezaDorrani 

     

    Can you please assist with this ?

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

    Hi @Anonymous ,

     

    The reason for this problem is that when SearchBox.Text is empty, the null character is considered to exist in the Title column.

    You should change your formula: Filter(Datasource, SearchBox.Text in Title || Status.Value = StatusDropdown.Selected.Value))
    to: Filter(Datasource, SearchBox.Text in Title || Status.Value = StatusDropdown.Selected.Value&&!IsBlank(SearchBox.Text)))

     

    Best Regards,

    Levi

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    That worked!

     

    Thank you so much!

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 July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 393 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 278 Most Valuable Professional

Last 30 days Overall leaderboard