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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

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.

Users online (1,644)