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))

This worked perfectly. Thanks for your help!

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Carousel_PP_768x460_Wave2 (1).png

2022 Release Wave 2 Plan

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

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Top Solution Authors
Users online (3,155)