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 / Compare two datetime c...
Power Apps
Unanswered

Compare two datetime columns in a SharePoint List gives Delegation Warning

(0) ShareShare
ReportReport
Posted on by 54

Hi all,

I have got a SharePoint list which contains a column called "ExpectedReturnTime" and another column "ReturnTime"

I wanted to check in PowerApps, who are the late people in a gallery using Filter function.

When I use ExpectedReturnTime<ReturnTime it gives me an runtime error. (Requested operation is invalid)

Then I used:  DateTimeValue(ExpectedReturnTime)< DateTimeValue(ReturnTime) in the filter function 

Now I'm getting Delegation warning.

So I created a calculated column called "LateRetruns" in share point list

=IF(ExpectedReturnTime<ReturnTime,"Late","Not Late") 

 

Then tried to filter in PowerApps using  LateReturns="Late"

Now I'm getting correct data, but still that Delegation Warning exists.

At the moment I have only 20 records.. But It will be more than 1000 records when its up and running.

Will this be an issue? or is there anyway we can fix this..

 

Thanks

 

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,034 Most Valuable Professional on at

    Hi @Naviya89 ,

    Firstly, DateTimeValue is not Delegable, nether are Calculated columns (which have many other issues and should not be used in Power Apps). If however ExpectedReturnTime and ReturnTime are Date/Time columns in SharePoint then you do not need DateTImeValue and can compare them directly the same as your Calculated column

    If(
     ExpectedReturnTime < ReturnTime,
     TrueResultHere,
     FalseResultHere
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • Naviya89 Profile Picture
    54 on at

    I want to use it for a gallery filter . It gives me an error.

     

    Naviya89_0-1643772579964.png

     

  • WarrenBelz Profile Picture
    153,034 Most Valuable Professional on at

    @Naviya89 ,

    Assuming the following

    • Your SharePoint list is called StaffMovingChecker
    • It has two Date/Time fields called ExpectedReturnTime and ReturnTime
    • The code below is being used as the Items of a gallery
    Filter(
     StaffMovingChecker,
     ExpectedReturnTime < ReturnTime
    )

    then the code is valid and will return any records where the ReturnTime is greater than the ExpectedReturnTime and will be Delegable.

    What in the above assumptions is not true?

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • Naviya89 Profile Picture
    54 on at
    • Your SharePoint list is called StaffMovingChecker  Correct
    • It has two Date/Time fields called ExpectedReturnTime and ReturnTime Correct
    • The code below is being used as the Items of a gallery Correct

    Naviya89_0-1643775584888.pngNaviya89_1-1643775634324.png

     

  • Naviya89 Profile Picture
    54 on at

    It works when I add DateTimeValue()... But comes with a warning

    Naviya89_2-1643776743811.png

     

  • WarrenBelz Profile Picture
    153,034 Most Valuable Professional on at

    @Naviya89 ,

    I am now getting the same thing here - this has got to be a bug as the query should work.

    DateTimeValue() however is not Delegable and the warning is to be expected. Unless the bug is fixed, there is no Delegable solution to this.

  • Naviya89 Profile Picture
    54 on at

    @WarrenBelz  Thanks for your time and effort. Highly appreciated .

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 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard