cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
New Member

Filter Date in a Gallery by DatePicker

I am currently trying to filter a large number of records by a specific date set by the date picker. When I user Date=DatePicker.SelectedDate, it give me an error that states, "Date eq 2018-01-10" is not valid. Date being the column name in my list and the specific date being the date selected. When I test using a label to see if the record date and the selected date are equal, I get a true value. Is there any way around this recent bug or is Powerapps going to need to fix this bug in their next update?

1 ACCEPTED SOLUTION

Accepted Solutions

I figured out a way to do it. I created another Single Line text column, on that field I took the date from my date column and copied it as a string in format 'dd/MM/yyyy'. I am using SharePoint as well and this has fixed my issue, now I can do:

 

Filter(Table1,DateConverted2TextColumn = Text(DatePicker.SelectedDate). Now, if my user selects a specific date then I only display in my gallery all items that matches the date picker value. 

View solution in original post

7 REPLIES 7
Power Apps
Power Apps

Thanks for raising this issue. I personally can't get the date filter to work either. I've filed a bug and we are having the SharePoint connector team look at it as we speak.

Power Apps
Power Apps

The delegation for date comparisons in SharePoint doesn't work (it hasn't worked in a long time, if ever). You can work around this by using a function that doesn't support delegation for the list. For example:

Filter(
    FirstN(YourSharePointList, 10000),
    Date = DatePicker1.SelectedDate)

I figured out a way to do it. I created another Single Line text column, on that field I took the date from my date column and copied it as a string in format 'dd/MM/yyyy'. I am using SharePoint as well and this has fixed my issue, now I can do:

 

Filter(Table1,DateConverted2TextColumn = Text(DatePicker.SelectedDate). Now, if my user selects a specific date then I only display in my gallery all items that matches the date picker value. 

View solution in original post

The solution provided by @iamlee works for me. Additionally I have created a calculated column which will save the date part of the Date column as text. 

See below picture

 

Date Calculated Column.PNG

How do you reset the date picker filter?

@Jsprince21  I did not reset the DatePicker. In my form by default "Today" is selected in the DatePicker and based on this I show data in the Gallery by filtering data from SharePoint list.

 

So, can you please tell me about your actual requirement?

 

Best Regards,

Mamun

I use a small cancel icon in the corner of the datepicker box with the onselcect set to Reset(DatePickerName)

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (53,152)