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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Search box and two fil...
Power Apps
Unanswered

Search box and two filters

(0) ShareShare
ReportReport
Posted on by

Hello everyone. I'm asking for help because I'm about to go crazy. I have the following code that searches and filters data

 

With({asmt:Filter(
 'TELEFONY — kopia';StartsWith(
 Nazwisko;szukaj_box.Text
 )
 )
 };
 If(
 filtr.Selected.Result = "Pokaż wszystkich pracowników"; asmt;
 Filter(
 asmt;Stanowisko=filtr.Selected.Result 
 )
 
 
 )
)

For quite a long time I have been trying to modify it to use two filters independently.

I created this monster, but it doesn't do anything except that when I click show all floors, the data disappears, but when I select a specific floor, nothing happens, i.e. I see all the data limited by the job position filter.

 

With(
 {
 asmt: Filter(
 'TELEFONY — kopia';
 StartsWith(Nazwisko; szukaj_box.Text)
 )
 };
 If(
 filtr.Selected.Result = "Pokaż wszystkich pracowników";
 asmt;
 If(
 filtr_1.Selected.Result = "Pokaż wszystkie piętra";
 Filter(asmt; 
 Text(Piętro) = filtr_1.Selected.Result
 );
 Filter(asmt; Stanowisko = filtr.Selected.Result)
 )
 )
)

 

 

Categories:
I have the same question (0)
  • Ami K Profile Picture
    15,679 Super User 2024 Season 1 on at

    @pablik01 - I don't quite understand the logic behind the filter parameters, but I think the below is what you're trying to do:

     

    With(
     {
     asmt: Filter(
     'TELEFONY — kopia';
     StartsWith(
     Nazwisko;
     szukaj_box.Text
     )
     )
     };
     With(
     {
     asmt2: Filter(
     asmt;
     Text(Piętro) = filtr_1.Selected.Result
     )
     };
     With(
     {
     asmt3: Filter(
     asmt;
     Stanowisko - filtr.Selected.Result
     )
     };
     If(
     filtr.Selected.Value = "Pokaż wszystkich pracowników";
     asmt;
     If(
     filtr_1.Selected.Result = "Pokaż wszystkie piętra";
     asmt2;
     asmt3
     )
     )
     )
     )
    )
  • pablik01 Profile Picture
    on at

    I managed to solve it, but now I have problems sorting the data alphabetically. I receive an error that the Last Name column does not exist

    This is unsorted code

     

    With({
     asmt: Filter(
     'TELEFONY — kopia';
     StartsWith(Nazwisko; szukaj_box.Text)
     );
    
     asmt_1: Filter(
     'TELEFONY — kopia';
     StartsWith('Nazwisko'; szukaj_box.Text)
     )
    };
     If(
     filtr.Selected.Result = "Pokaż wszystkich pracowników";
     If(
     filtr_1.Selected.Result = "Pokaż wszystkie piętra";
     
     asmt_1;
     Filter(
     asmt_1;
     Text(Piętro) = filtr_1.Selected.Result
     )
     );
     Filter(
     asmt;
     Stanowisko = filtr.Selected.Result
     )
     )
    )

     

    With sort

    With(
     {
     asmt: SortByColumns(
     Filter(
     'TELEFONY — kopia';
     StartsWith(Nazwisko; szukaj_box.Text)
     );
     "Nazwisko"
     );
     asmt_1: SortByColumns(
     Filter(
     'TELEFONY — kopia';
     StartsWith('Nazwisko'; szukaj_box.Text)
     );
     "Nazwisko"
     )
     };
     If(
     filtr.Selected.Result = "Pokaż wszystkich pracowników";
     If(
     filtr_1.Selected.Result = "Pokaż wszystkie piętra";
     
     SortByColumns(asmt_1; "Nazwisko");
     SortByColumns(
     Filter(
     asmt_1;
     Text(Piętro) = filtr_1.Selected.Result
     );
     "Nazwisko"
     )
     );
     SortByColumns(
     Filter(
     asmt;
     Stanowisko = filtr.Selected.Result
     );
     "Nazwisko"
     )
     )
    )

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Kalathiya Profile Picture

Kalathiya 393

#2
WarrenBelz Profile Picture

WarrenBelz 345 Most Valuable Professional

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 271 Super User 2025 Season 2

Last 30 days Overall leaderboard