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

Announcements

News and Announcements icon
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 ....?

 

2020-05-21_13-01-53.jpg
Categories:
I have the same question (0)
  • Verified answer
    v-bofeng-msft Profile Picture
    Microsoft Employee 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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 366 Most Valuable Professional

#2
11manish Profile Picture

11manish 184

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 99 Super User 2026 Season 1

Last 30 days Overall leaderboard