How can I avoid Delegation Warning when trying to filter a SharePoint list based on the absence of a value in a Datetime column?
Here's the situation -- I have a SharePoint list that includes four datetime columns for sequential tasks. For simplicity:
ID | Task 1 | Task 2 | Task 3 | Task 4
There are well over 500 rows in this list.
I'm using a PowerApp to pull back records from this list, change/add datetimes, then Patch the records back to the list.
If all four tasks are complete, I don't need to pull the record into the PowerApp. Tasks 1-4 are completed sequentially, so for convenience, I truly only need to check if Task 4 has a value.
Any technique I try to filter the list is giving a delegation warning. From searching around this forum, it seems = is the only operator I can use to avoid a delegation warning in a date or datetime column. However I can't use = here, as I'm trying to find records that have no value in the datetime column. I also considered adding a calculated column in sharepoint, but it seems any use of a calculated column gives a delegation warning as well.
=ClearCollect(TaskColl,Filter(TaskTable,'Task 4'=0)) --> Does not return any records =ClearCollect(TaskColl,Filter(TaskTable,'Task 4'<1) --> Delegation warning
=ClearCollect(TaskColl,Filter(TaskTable,Len('Task 4')=0) --> Delegation warning
=ClearCollect(TaskColl,Filter(TaskTable,IsBlank('Task 4')) --> Delegation warning
Is there some workaround here? Open to any suggestions.
Solved! Go to Solution.
They have some documentation on the IsBlank vs = Blank()
I have been using this on date fields and they do not give the delegation warning in PowerApps
I have tested this with a data source of more than delegable limit items and it works
Yes, that is the documentation reference in regard to testing for blank values. That is perfectly correct. However, if you read into the delgation chart directly above it, it specifically states that the equal operator is not delegable to a DateTime column (which is absolutely true). In this case, using the dataTimeColumn = Blank() IS using the equality operator. So, based on the official docs, it should not work.
Personally, I try to avoid those situations of using something that is contrary to the docs (or at least a release note) in favor of another workaround as those are the kind of things that people run into where they post - "hey my app has been working fine and I changed nothing and now it doesn't work" - why? because they were using something not officially supported and it got "fixed".
I'd be perfectly fine if it works and stays working...just be cautious is all I'm adding here.
Not as much that as three lines up on the equality (=) operator and the DateTime column.
Actually, yes - I think this may work. Blank (or null) is different from an actual DateTime value. You're not assigning a value, you're setting the value to null (which is the absence of a value). The issue with our not supporting DateTime for delegation has to do with different DateTime supported formats and null is independent of that. We'll double check but I think this probably works.
From Carlos who tested this out. " ... they can filter a SPO data source on whether a Date (or Date/Time) column is null. They cannot filter where the column is not null, however, as only the = (not the <>) operator is delegated to SharePoint (and the Not operator is also not delegated) " I will update the documentation.
Learn how to create your own user groups today!
Please join us on Wednesday, January 19th, at 8a PDT. Come and learn from our amazing speakers!
Check out the new Power Platform Community Connections gallery!