cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Sammy
Helper IV
Helper IV

How to get a filter search and datepicker working at the same time

I am fairly new to PowerApps and I've managed to get a datepicker working and text input filter search working, but not at the same time.

 

Can anyone tell me where I'm going wrong?

 

Datepicker:

Sort(Filter(Pages, DatePicker1.SelectedDate<=Created_x0020_date0), If(SortDescending1, Descending))

 

Filter search:

SortByColumns(Search(SortByColumns(Pages,"Created",Descending),TextSearchBox1.Text,"{Name}"),"Created",If(SortDescending1,Ascending,Descending))

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
CarlosFigueira
Power Apps
Power Apps

You can have the result of the Filter function as the first parameter of the Search function (and vice-versa, since the "shape" of the table that they return are the same). For example, this expression should work:

SortByColumns(
    Search(
        Filter(
            Pages,
            DatePicker1.SelectedDate <= Created_x0020_date0),
        TextSearchBox1.Text,
        "{Name}"),
    "Created",
    If(SortDescending1, Ascending, Descending))

View solution in original post

2 REPLIES 2
CarlosFigueira
Power Apps
Power Apps

You can have the result of the Filter function as the first parameter of the Search function (and vice-versa, since the "shape" of the table that they return are the same). For example, this expression should work:

SortByColumns(
    Search(
        Filter(
            Pages,
            DatePicker1.SelectedDate <= Created_x0020_date0),
        TextSearchBox1.Text,
        "{Name}"),
    "Created",
    If(SortDescending1, Ascending, Descending))

View solution in original post

This worked perfectly. Thanks for your help!

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (2,538)