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

Highlighted
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
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (5,071)