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 / Avoiding delegation wa...
Power Apps
Unanswered

Avoiding delegation warning in collection

(0) ShareShare
ReportReport
Posted on by 187

Thanks to some helpful posts on this forum, I'm using a function to collect a range of dates in a collection. I'm also looking to add a column to the code, that uses LookUp on a SharePoint list to verify dates. The code all works, but I get a delegation warning on the checkDate=DateAdd(weekStart, Value, Days) part. If I change 'Value' to a static number, this warning goes away. Is there any way to avoid this delegation warning at all, whilst using the current Value?

 

Or is the warning in this instance not a big deal and therefore I shouldn't worry about it?

 

 

 

ClearCollect(
 DateRange,
 AddColumns(
 FirstN(
 [0,1,2,3,4],
 DateDiff(weekStart, DateAdd(Today(),1-Weekday(Today(),StartOfWeek.Monday)+4,Days), Days) + 1),
 "Day",
 "Day " & (Value + 1),
 "Date",
 DateAdd(weekStart, Value, Days),
 "complete",If(IsBlank(LookUp(sfbbLogs,checkDate=DateAdd(weekStart, Value, Days))),false,true)
 )
)

 

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

    Hi @JamesSnaps ,
    Date queries are not Delegable, not matter how you "wrap" them. I have a workaround in this section of my blog on Delegation, although it may not be suitable for you.

     

    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.

  • JamesSnaps Profile Picture
    187 on at

    Hi @WarrenBelz , thanks for the reply. Why would the function appear as fine (no delegation warning) when I change 'value' to a static number, e.g. 1. Is that not still a date query? It would appear that it's the use of 'Value' that is causing the warning, so just curious.

     

     

     

     

    ClearCollect(
     DateRange,
     AddColumns(
     FirstN(
     [0,1,2,3,4],
     DateDiff(weekStart, DateAdd(Today(),1-Weekday(Today(),StartOfWeek.Monday)+4,Days), Days) + 1),
     "Day",
     "Day " & (Value + 1),
     "Date",
     DateAdd(weekStart, Value, Days),
     "complete",If(IsBlank(LookUp(sfbbLogs,checkDate=DateAdd(weekStart, 1, Days) && nurseryID=varNursery.ID)),false,true)
     )
    )

     

     

    I can also change checkDate=DateAdd(weekStart, Value, Days) to just be checkDate=Today() and that also works fine, no warning. But using Value anywhere in the formula results in a delegation warning

     

     

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

    Hi @JamesSnaps ,

    I am not sure - I have not tried that one myself. Beware however that there are a number of things you can do in Power Apps that are "hidden" delegation limitations (the With() statement is one of them), but I have never been able to filter large data sets on date fields.

     

    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.

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

    Hi @JamesSnaps ,

    Just checking if you got the result you were looking for on this thread. Happy to help further if not.

    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.

  • JamesSnaps Profile Picture
    187 on at

    I think so Warren, I used the information to basically set up a different workflow that wouldn't suffer from being non-delegable, so thanks for the clarification.

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 333 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard