cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
gavinleung
Level 8

Filter Sharepoint List by Date

Hi all, 

 

I have a Sharepoint List which contains a Date/Time field, called "Assignment Date". In my app, I have an gallery to show the list records. 

 

I want to show the list records by Today only. As suggested from some previous posts, I tried this but still didn't work:

Filter('Standard Work Plan', 'Assignment Date'= Date(Year(Today()), Month(Today()),Day(Today())))

 

Can anyone advise ? 

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Filter Sharepoint List by Date

The problem with Filtering by a DateTime column is that even if the column is set for Date Only it still returns a Date and Time value.  So to use it in a filter you really need to format both the DateTime column and the target Date time. Use something like this

Filter(Test,Text('Assignment Date',DateTimeFormat.ShortDate)=Text(Today(),DateTimeFormat.ShortDate))


-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
2 REPLIES 2
shailendra74
Level 8

Re: Filter Sharepoint List by Date

Hi @gavinleung 

 

Can you have your SP data in a collection and then filter based on current date

 

ClearCollect(collData, 'Standard Work Plan') // use ShowColumns to display required fields

 

Set the Data source of Gallery/DataTable with:

Filter(collData, AssignmentDate = DateValue(Text( Now(), "dd-mm-yyyy"))) // check the format you get in collection

 

Thanks.

Super User
Super User

Re: Filter Sharepoint List by Date

The problem with Filtering by a DateTime column is that even if the column is set for Date Only it still returns a Date and Time value.  So to use it in a filter you really need to format both the DateTime column and the target Date time. Use something like this

Filter(Test,Text('Assignment Date',DateTimeFormat.ShortDate)=Text(Today(),DateTimeFormat.ShortDate))


-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Helpful resources

Announcements
SecondImage

Join our Live PowerApps Webinar

Tomorrow, September 24st at 10am PDT

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Users Online
Currently online: 337 members 4,968 guests
Please welcome our newest community members: