I have a if statement filter before my patch and i'm struggling to find the best way to do this.
Here is my code:
ForAll(BarcodeReader1_3.Barcodes,
If(Not(IsEmpty(Filter('PS - Equipment Tracking', Title = Value && Status = "Deploy Pending" && 'Authorized Name' <> ComboBox5_5.Selected.DisplayName)))), do the thing!
As you know the '<>' causes a delegation warning and there are absolutely more than 2k records in the sharepoint table.
So I started to do this to do almost a double check, but its causing slowness and network issues:
ForAll(BarcodeReader1_3.Barcodes,
If(IsEmpty(Filter('PS - Equipment Tracking', Title = Value && Status = "Deploy Pending")), Collect(NoMatch, Value),
If(IsEmpty(Filter('PS - Equipment Tracking', Title = Value && Status = "Deploy Pending" && 'Authorized Name' = ComboBox5_5.Selected.DisplayName)),
do the thing!
So this fixed the delegation but as you can see its not optimized because now its checking to see if the status is deploy pending and if not put it in a nomatch collection and then do a check if its not deploy pending and not auth = person on screen, then do the thing.
This is now causing an error that says "error collecting data from network" which i'm assuming is because of the double full database round check.
How would you go about this? Here is what I'm trying to do:
Update/do the thing only if the following is met:
The barcode scanned (value) = the title in the sharepoint list
The status = deploy pending
and the authorizer is not the same person on the screen in my combobox field.
Thank you!
It is working which is great, I dont see too much of a difference with the loading time to navigate off when its done, but i'm waiting to deploy it to prod to have folx test it to see if it resolves their error or not. I'll let you know, thank you!
Hi @Nicci,
The not operator is indeed not delegable for SharePoint. A partly delegable alternative would be prefiltering via the delegable conditions first (status & title) after which we apply the non-delegable authorized name condition:
ForAll(
BarcodeReader1_3.Barcodes,
If(
!Empty(
With(
{
//Prefilter via delegable query (should return less than your Data Row Limit)
wPrefilter: Filter(
'PS - Equipment Tracking',
Title = Value,
Status = "Deploy Pending"
)
},
//Filter via non-delegable condition
Filter(
wPrefilter,
'Authorized Name' <> ComboBox5_5.Selected.DisplayName
)
)
)
)
)
If this solves your question, would you be so kind as to accept it as a solution.
Thanks!