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
Solved! Go to Solution.
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))
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.
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))
User | Count |
---|---|
174 | |
116 | |
85 | |
44 | |
41 |
User | Count |
---|---|
238 | |
152 | |
131 | |
77 | |
72 |