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)
)
)
Solved! Go to Solution.
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.
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.
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.
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.
User | Count |
---|---|
251 | |
249 | |
82 | |
45 | |
27 |
User | Count |
---|---|
350 | |
265 | |
127 | |
60 | |
58 |