cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JamesSnaps
Advocate IV
Advocate IV

Avoiding delegation warning in collection

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)
    )
)

 

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User III
Super User III

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.

View solution in original post

5 REPLIES 5
WarrenBelz
Super User III
Super User III

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.

View solution in original post

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

 

 

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
Super User III
Super User III

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.

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.

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

PA Community Call

Power Apps Community Call

Next call is happening on April 21st at 8a PST.

MBAS Carousel

Sign up for our May 4th event!

May the fourth be with you, join us online!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors
Users online (46,339)