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 / Delegation warning on ...
Power Apps
Answered

Delegation warning on date compare

(0) ShareShare
ReportReport
Posted on by 15

HI Experts,

 

I have been battling with this date issue for far to long now and need some assistance. I am trying to compare two dates (date in SQL table with 

 

 

 

 

 

 

 

Istoday()

 

 

 

 

 

 

 

and depending on the result, get that items ID. The code I currently have now works, but is giving me a delegation warning.

 

 

 

 

 

 

 

Set(SessionID,LookUp(tblTimeSheet_Data,ANumber = varCurrentUser && IsToday(StartDayDate),Id));

 

 

 

 

 

 

 

leeboygp_0-1693912392273.png

The delegation warning comes from the 

 

 

 

 

 

 

 

istoday

 

 

 

 

 

 

 

part of the formula. I have tried other ways, but I am just not getting it right.

 

I also tried the below formula, but this one is not returning anything.

 

 

 

 

 

 

 

 

Set(Comparedate,DateAdd( Today(),1,TimeUnit.Days));
Set(SessionID,LookUp(tblTimeSheet_Data,ANumber = varCurrentUser && StartDay < Comparedate,Id));

 

 

 

 

 

 

 

 

Categories:
I have the same question (0)
  • leeboygp Profile Picture
    15 on at

    What else can I use instead of isToday()?

  • SpongYe Profile Picture
    5,715 Super User 2026 Season 1 on at

    Hi @leeboygp 

     

    Try this:

    Set(SessionID,
    
    With(
     {
     _tblTimeSheet_Data:
     LookUp(
     tblTimeSheet_Data, 
     ANumber = varCurrentUser
     )
     },
     Filter(
     _tblTimeSheet_Data,
     IsToday(StartDayDate)
     ),
     Id
    )
    
    );

     


    ------------------------------------------------------------------------------------------------------------------------------
    If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

    If you like my response, please give it a Thumbs Up.

  • leeboygp Profile Picture
    15 on at

    Hi @SpongYe 

     

    Its not working.

    leeboygp_0-1693916431880.png

     

  • Chris-D Profile Picture
    1,246 on at

    You could try using this?

    StartDayDate = Today()

     

  • leeboygp Profile Picture
    15 on at

    Hi @Chris-D ,

     

    I tried this, but got nothing back. No errors, but it brings no results. the date format on SQL is 2023-09-05

  • leeboygp Profile Picture
    15 on at

    date format on SQL

    leeboygp_0-1693916972096.png

     

  • SpongYe Profile Picture
    5,715 Super User 2026 Season 1 on at

    HI @leeboygp 

     

    This should work:

    Set(SessionID,
    
    With(
     {
     _tblTimeSheet_Data:
     LookUp(
     tblTimeSheet_Data, 
     ANumber = varCurrentUser
     )
     },
     Filter(
     _tblTimeSheet_Data,
     IsToday(StartDayDate)
     ).Id
    )
    
    );

    I forget that the comma has to be a dot before the Id. 

    If that doesnt work try this:

     

    Set(SessionID,
    With(
     {
     _tblTimeSheet_Data:
     LookUp(
     tblTimeSheet_Data, 
     ANumber = varCurrentUser
     )
     },
     LookUp(
     _tblTimeSheet_Data,
     IsToday(StartDayDate),
     Id
     )
    )
    
    );
  • leeboygp Profile Picture
    15 on at

    Unfortunately, I'm getting an error with both formulas.

     

    leeboygp_1-1693925694114.png

    not sure whats next 😞

     

  • Verified answer
    SpongYe Profile Picture
    5,715 Super User 2026 Season 1 on at

    Hi @leeboygp 

     

    We are using the IsToday() function the wrong way. Thats why its giving a error.

    A filter or Lookup need to match a record and IsToday() returns a Boolean. 

     

    This should work:

    Set(SessionID,
    
    With(
     {
     _tblTimeSheet_Data:
     LookUp(
     tblTimeSheet_Data, 
     ANumber = varCurrentUser
     )
     },
     Filter(
     _tblTimeSheet_Data,
     Text(StartDayDate) = Text(Today(), "yyyy-mm-dd")
     ).Id
    )
    
    );

     


    ------------------------------------------------------------------------------------------------------------------------------
    If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

    If you like my response, please give it a Thumbs Up.

  • leeboygp Profile Picture
    15 on at

    This code still gives me errors. However, I have managed to resolve my issue by using sort instead. Like below:

     

    Set(SessionID,LookUp(Sort(tblTimeSheet_Data,Id,SortOrder.Descending),ANumber = varCurrentUser,Id));

     

    Thank you so much for your assistance, i really appreciate it.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 541

#2
WarrenBelz Profile Picture

WarrenBelz 434 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 289

Last 30 days Overall leaderboard