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 / Help With Delegation W...
Power Apps
Answered

Help With Delegation Warning

(0) ShareShare
ReportReport
Posted on by
Hello,
 
I have a delegation issue that I was trying to work around, but am having no luck.  I have the following code:
 
ClearCollect(
FilteredDataverseTable,
ShowColumns(
If(ComboBox1.Selected.Value = "Choice1",
Filter(DataverseTable, DateValue('Custom Date/Time') = DateValue(Today())),
If(ComboBox1.Selected.Value = "Choice2",
Filter(DataverseTable, Email in Filter('DataverseTable2', 'Status' = "Yes").Mail,
DateValue('Custom Date/Time') = DateValue(Today())),
If(ComboBox1.Selected.Value = "Choice3",
Filter(DataverseTable, Section = ComboBox1.Selected.Value,
DateValue('Custom Date/Time') = DateValue(Today())
)
),"customdatetime","location","comments","name","section")
);
 
The section of code that is used in the if statements that is getting the delegation warning is: DateValue('Custom Date/Time') = DateValue(Today())
The warning recieved is: Delegation Warning. The "DateValue" part of this formula might not work correctly on large datasets.
 
I have tried the following:
'Custom Date/Time' = Today()), which didn't show any records in the app.
'Custom Date/Time' = glbDateToday, which glbDateToday was set as Set(glbDateToday, Today()) in the app OnStart.  This also produced no records in the app.
 
I see records in the app with the code as is, DateValue('Custom Date/Time') = DateValue(Today()), but I am not seeing all of the records due to non-delegable functions.  Any help would be greatly appreciated!
Categories:
  • Verified answer
    Michael E. Gernaey Profile Picture
    53,975 Super User 2026 Season 2 on at

    Hi @john3j 

     

    The Reason is that neitehr Now() or Today() are delegatable also for datevalue. 

     

    Try, assigning those values to a variable first, then replacing them in your ClearCollect.

     

    Also note that ClearCollect isn't delegatable in itself.


    If I have helped you, I would really appreciate if you please Mark my answer as Resolved/Answered, and give it a thumbs up, so it can help others

    Cheers

    Thank You
    Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey

  • john3j Profile Picture
    on at

    @FLMike - I actually ended up creating a text column in the data source to store the date as text. Then, at app OnStart I did: Set(gblDateToday, Text(Now(), "mm/dd/yyyy")).  I just have updated my other code to sort off of that new text column and it works like a charm.  Thanks!

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 236 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 188 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 130

Last 30 days Overall leaderboard