cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AlanCampbell
Level: Powered On

Filter SharePoint list date column using date picker with = expression

Hi all, I think I found a bug, I'm using the below filter in a gallery to show matches for a specific day, which is selected in a datepicker

 

Filter('member-availability', Available_Day = Date(Year(WhosAvailableDatePicker.SelectedDate),Month(WhosAvailableDatePicker.SelectedDate),Day(WhosAvailableDatePicker.SelectedDate)))

 

I get the error

 

"The requested operation is invalid

Server response, The expression "Available_Day eq 2017-10-25" is not valid"

 

But if the change the sing to a <=, => or <> it works but I only want the sign day? does anyone know of a work around?

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Filter SharePoint list date column using date picker with = expression

Hi AlanCampbell,

 

I can reproduce this issue on my side. I will try to report it.


When filter the gallery using date picker with = expression, it returns the same error message with you.

3.PNG

 

Then I figure out a workaround for this. Use Text function to convert the date to a string of text. I found that it works properly.
Filter(List2,Date=Text(DatePicker1.SelectedDate,DateTimeFormat.ShortDate))

4.PNG

 

Please try the workaround on your side. Hope it will work for you.

 

Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Community Support Team
Community Support Team

Re: Filter SharePoint list date column using date picker with = expression

Hi AlanCampbell,

 

I can reproduce this issue on my side. I will try to report it.


When filter the gallery using date picker with = expression, it returns the same error message with you.

3.PNG

 

Then I figure out a workaround for this. Use Text function to convert the date to a string of text. I found that it works properly.
Filter(List2,Date=Text(DatePicker1.SelectedDate,DateTimeFormat.ShortDate))

4.PNG

 

Please try the workaround on your side. Hope it will work for you.

 

Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Anonymous
Not applicable

Re: Filter SharePoint list date column using date picker with = expression

Hi Mabel Mao, Just saw your post and tried to replicate your solution. It doesn't work properly. It gives the following warning: Incompatible type. We can't evaluate your formula because the values being compared in the formula aren't the same type. The left value is a Date type and the right is a Text type. Is there currently any update on how else to resolve this issue? My current code is as follows: SortByColumns(Filter(Timesheet, Charge_date = Text(DatePicker1.SelectedDate,DateTimeFormat.ShortDate)), "Title", If(SortDescending1, Descending, Ascending))
Super User
Super User

Re: Filter SharePoint list date column using date picker with = expression

Hi @Anonymous 

 

Another thing to consider is that queries to date columns in SP are not delegatable (nor is calculated columns in SP), so if you have to use SharePoint for the data, the other option would be to use Flow to fetch the data and return it to PowerApps. Flow can use ODATA queries to get to the correct data and then possibly manipulate or join the data with other services before returning it to PowerApps. I love this approach and it has come in extremely handy in the past. Some might say that using a flow for retrieving data might feel 'expensive' but it does allow for many different functional and security options going forward.


See below demo what can be achieved with this. Please see below and let us know if you have any questions or suggestions:

https://youtu.be/m_j_xN7-LjU

 

Twitter: @dawidvh

YouTube: https://www.youtube.com/user/dawidvanheerden
**If you found this reply helpful, please mark this as the answer to close the topic and make it easier to find for other people with similar questions.

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (7,839)