web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Filter SharePoint Date...
Power Apps
Answered

Filter SharePoint Date field

(0) ShareShare
ReportReport
Posted on by 152

I'm encountering problem with SharePoint date field, on my canvas app.

 

There is a date field named "ReportDate" at SharePoint list named "Reports".

Canvas app, at App OnStart, I wrote;
 Set(varToday, Today())

then, on a screen, I place the button with OnSelect, Set(varTodaysReport, Filter(Reports, ReportDate=varToday))

I got an error with "Creating query failed" (See attachment pic)

 

Is this a problem with my formula or ....?

 

Categories:
I have the same question (0)
  • Verified answer
    v-bofeng-msft Profile Picture
    on at

    Hi @Sam44 :

    The commonly used method is using DateValue (Text ()) together to format the Date Type from SharePoint list to make it in the same format as Today () in PowerApps.

    For example:

     

    Set(varTodaysReport, Filter(Reports, DateValue(Text(ReportDate)) = varToday))

     

    Or

     

    Set(varTodaysReport, Filter(Reports, Text(ReportDate,ShortDate) = Text(varToday,ShortDate)))

     

    There are some similar posts for your reference:

    https://powerusers.microsoft.com/t5/Building-Power-Apps/Can-not-filter-SharePoint-list-on-date-using-equals-but-greater/td-p/390250

    https://powerusers.microsoft.com/t5/Building-Power-Apps/Filter-and-Lookup-not-working-with-date-values/td-p/39656

    Best Regards,

    Bof

  • CU-21080815-8 Profile Picture
    152 on at

    Got it.

    I usually use CDS as data-source then was wondered why this formula is OK with CDS but not SharePoint, but got a point.

    Thank you!

  • rizwanmgm Profile Picture
    on at

    solved with minor modification

    With({_preFilter: Filter('Meeting Room', EmployeeEmail=User().Email)},
    
     ClearCollect(colDashboard,
     Sort(
     Filter(
     AddColumns(_preFilter,
     "_bookingDate", DateValue(BookingDate)
     ),
     DateValue(Text(BookingDate,"dd-mm-yyyy")) >=DateValue(Text(Today(),"dd-mm-yyyy"))
     ),
     _bookingDate,Ascending
     )
     )
    );

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard