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 Filter and Sort...
Power Apps
Answered

Search Filter and Sort Gallery

(0) ShareShare
ReportReport
Posted on by 107

Hi

I tried searching, filtering and sorting my gallery and almost suceeded 😉

 

I get the text box, the sort functions and one drop down filter to work, but when i try to include the second drop down filter, I fail.

 

marczh_0-1631798367332.png

With this code, the first drop down is working just fine.

SortByColumns(
 Search(
 If(
 DropdownStatus.Selected.Result = "Alle";
 'Reporting Vermietung';
 Filter(
 'Reporting Vermietung';
 'Status Text' = DropdownStatus.Selected.Result
 )
 );
 TextSearchBox1_1.Text;
 "Objekt";
 "PFM";
 "Status_x0020_Text";
 "Mieter"
 );
 SortColumn;
 If(
 SortDescending1;
 Descending;
 Ascending
 )
)

I tried to include the second filter drop down like this, but it's not working properly:

SortByColumns(
 Search(
 If(
 DropdownStatus.Selected.Result = "Alle" || DropdownPFM.Selected.Result = "Alle";
 'Reporting Vermietung';
 Filter(
 'Reporting Vermietung';
 'Status Text' = DropdownStatus.Selected.Result || PFM = DropdownPFM.Selected.Result
 )
 );
 TextSearchBox1_1.Text;
 "Objekt";
 "PFM";
 "Status_x0020_Text";
 "Mieter"
 );
 SortColumn;
 If(
 SortDescending1;
 Descending;
 Ascending
 )
)

Many thanks in advance 🙂

Categories:
I have the same question (0)
  • StalinPonnusamy Profile Picture
    Super User 2024 Season 1 on at

    Hi @marczh

     

    Please try this

    With(
     {_Item: 'Reporting Vermietung'};
    SortByColumns(
     Search(
     If(
     DropdownStatus.Selected.Result = "Alle" || DropdownPFM.Selected.Result = "Alle";
     _Item;
     Filter(
     _Item;
     'Status Text' = DropdownStatus.Selected.Result || PFM = DropdownPFM.Selected.Result
     )
     );
     TextSearchBox1_1.Text;
     "Objekt";
     "PFM";
     "Status_x0020_Text";
     "Mieter"
     );
     SortColumn;
     If(
     SortDescending1;
     Descending;
     Ascending
     )
    )
    )
  • marczh Profile Picture
    107 on at

    When I select the first dropdown nothing happens when I select the second drop down it is filtering something in a wrong weird way. The search box is working finde. Eventough there is no error message from the code. 

     

    I think the problem is maybe in the Or Statement for the two filters?

     

     

  • marczh Profile Picture
    107 on at

    with this code 

     

    With(
     {_Item: 'Reporting Vermietung'};
    SortByColumns(
     Search(
     If(
     DropdownStatus.Selected.Result <> "Alle" Or DropdownPFM.Selected.Result <> "Alle";
     Filter(
     _Item;
     'Status Text' = DropdownStatus.Selected.Result Or PFM = DropdownPFM.Selected.Result
     );
     _Item
     );
     TextSearchBox1_1.Text;
     "Objekt";
     "PFM";
     "Status_x0020_Text";
     "Mieter"
     );
     SortColumn;
     If(
     SortDescending1;
     Descending;
     Ascending
     )
    )
    )

     

    The Dropdowns are working but just if One of them is set to "Alle"

     

    Is there a way they work both dynamically together despite the value of the other?

  • Verified answer
    StalinPonnusamy Profile Picture
    Super User 2024 Season 1 on at

    Hi @marczh

     

    Both Dropdown selection is optional now.

    With(
     {_Item: 'Reporting Vermietung'};
    SortByColumns(
     Search(
    Filter(
     _Item,
     (DropdownStatus.Selected.Result = "Alle" || 'Status Text' = DropdownStatus.Selected.Result) && (DropdownPFM.Selected.Result = "Alle" || PFM = DropdownPFM.Selected.Result)
     );
     TextSearchBox1_1.Text;
     "Objekt"
     "PFM";
     "Status_x0020_Text";
     "Mieter"
     );
     SortColumn;
     If(
     SortDescending1;
     Descending;
     Ascending
     )
    )
    )

     

     

     

  • marczh Profile Picture
    107 on at

    @StalinPonnusamy Thank you very much, this works out just fine! Even if don't understand a 100% of the syntax 🙂

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
WarrenBelz Profile Picture

WarrenBelz 356 Most Valuable Professional

#2
11manish Profile Picture

11manish 225 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 211

Last 30 days Overall leaderboard