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

Filter gallery of Sharepoint list by date

I am having problems filtering a gallery based on a date column in a Sharepoint list.

Sharepoint List = OnboardTasks

Date Column = Due_Date

Calculated Column = DDNumber

Formula =VALUE(YEAR(Due_Date)&RIGHT("00"&MONTH(Due_Date),2)&RIGHT("00"&DAY(Due_Date),2))

 

The following filter works fine but does not filter dates:

Current filter = Filter(OnboardTasks, Completed=false, Dropdown2.Selected.Value = Assigned_x0020_To)

 

Things I have tried that give blue warning: “Part of this formula cannot be evaluated remotely…”

 

Filter(OnboardTasks, Due_x0020_Date>08/01/2017, Completed=false, Dropdown2.Selected.Value = Assigned_x0020_To)

Filter(OnboardTasks, Due_x0020_Date>Date(2017,8,15), Completed=false, Dropdown2.Selected.Value = Assigned_x0020_To)

 

I have tried MANY ways with no success. I have tried to use the calculated column as well.

 

When the calculated column is placed on a label, it displays with 7 zeros after decimal.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Narula_Srinivas
Level: Powered On

Re: Filter gallery of Sharepoint list by date

After spending more than a day...I could able to filter sharepoint list date column with powerapp datepicker.

 

Instead of passing DatePicker2.SelectedDate directly to sharepoint date column. We need to pass Year,Month & Day seperately as shown below.

 

 

ActivityStartDate<=Date(Year(DatePicker2.SelectedDate),Month(DatePicker2.SelectedDate),Day(DatePicker2.SelectedDate))

 

 

Hope this helps someone.

 

Happy Coding!!

 

View solution in original post

9 REPLIES 9
Community Support Team
Community Support Team

Re: Filter gallery of Sharepoint list by date

Hi TMR,

 

Please try to add a Date picker control on your app. Then filter using the value of the Date picker control.


I am using the value of Date picker control to filter a gallery and it is working fine.


The function I am using is:
Filter(ProjectEmail,Date>DatePicker2.SelectedDate,Status.Value="Pending")


Please try it on your side and let me know if 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.
TMR
Level: Powered On

Re: Filter gallery of Sharepoint list by date

Thanks for your reply v-yamao-msft,

 

I added a DatePicker and tried it without success 

 

Below was my first test:

Filter(OnboardTasks, Due_x0020_Date=DatePicker1.SelectedDate, Completed=false, Dropdown2.Selected.Value = Assigned_x0020_To)

The requested operation is invalid.

The second test I tried filtering by JUST the DatePicker:

Filter(OnboardTasks, Due_x0020_Date=DatePicker1.SelectedDate)

The requested operation is invalid.

Narula_Srinivas
Level: Powered On

Re: Filter gallery of Sharepoint list by date

After spending more than a day...I could able to filter sharepoint list date column with powerapp datepicker.

 

Instead of passing DatePicker2.SelectedDate directly to sharepoint date column. We need to pass Year,Month & Day seperately as shown below.

 

 

ActivityStartDate<=Date(Year(DatePicker2.SelectedDate),Month(DatePicker2.SelectedDate),Day(DatePicker2.SelectedDate))

 

 

Hope this helps someone.

 

Happy Coding!!

 

View solution in original post

Patrick2DOS
Level: Power Up

Re: Filter gallery of Sharepoint list by date

I have an easier solution:

Just filter the gallery with a TextSearchBox

 

All you need is your gallery and a TextField, which you would rename as "TextSearchBox1".

Sort(If(IsBlank(TextSearchBox1), YourSharePointList, Filter(YourSharePointList, TextSearchBox1.Text in Text(Created, DateTimeFormat.ShortDate, "en-US"))), Created, Descending)

 

Only the formatting with the Text-function makes the SharepointList searchable by "created".

 

Now you can filter the gallery by just tiping in the date. Remember that the dateformat must be concording to the languge settings (in this case US-English). 

In the TextSearchBox you would tipe in MM/DD/YYYY e.g. 03/24/2018 and get the items from this date.

 

Works well in my lists.

Anonymous
Not applicable

Re: Filter gallery of Sharepoint list by date

Hey there, I was (and still am) trying to Filter a Gallery by a DatePicker, I used your formula and worked, but May I ask a question, may I filter Date = DatePicker? 

I tried but the i could not because my Date format I had to do this : Text ( DateAdd(ThisItem.Data; TimeZoneOffset(ThisItem.Data);Minutes) ; "[$-pt-BR]dd/mm/yyyy" ; "pt-BR" )

iamlee
Level 8

Re: Filter gallery of Sharepoint list by date

Hi - I tried this one and I still get that 'delegation warning. 

 

Filter(SharePointList, SPDateTimeColumn >= DatePicker1.SelectedDate), PowerApps gives a blue warning on SPDateTimeColumn. Is it because it's a date time column?

 

Dawidvh
Level 10

Re: Filter gallery of Sharepoint list by date

Hi @iamlee 

 

I think the best solution for this would be an integer column in SQL that converts the date to a number.  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.

RussellGove
Level 10

Re: Filter gallery of Sharepoint list by date

This solution works , but only on small Datasets. It gives a delegation warning. Any idea how to do this with delegation?

Dual Super User
Dual Super User

Re: Filter gallery of Sharepoint list by date

Hi @RussellGove 

 

https://www.youtube.com/watch?v=eCMuXPI1Qok

 

--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

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 (Last 30 Days)
Users online (4,404)