Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Help on Filter and delegation issues

(0) ShareShare
ReportReport
Posted on by 194
  • Hi Everyone,

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!

Categories:
  • Nicci Profile Picture
    Nicci 194 on at
    Re: Help on Filter and delegation issues

    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!

  • Verified answer
    LaurensM Profile Picture
    LaurensM 12,510 on at
    Re: Help on Filter and delegation issues

    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!

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,666

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,996

Leaderboard