cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

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
Highlighted
Advocate I
Advocate I

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
Highlighted
Community Support
Community Support

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.
Highlighted
Frequent Visitor

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.

Highlighted
Advocate I
Advocate I

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

Highlighted
New Member

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.

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

Highlighted
Resolver I
Resolver I

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?

 

Highlighted
Super User
Super User

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.

Highlighted
Kudo Kingpin
Kudo Kingpin

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?

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

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (9,173)