web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / SharePoint list FILTER...
Power Apps
Unanswered

SharePoint list FILTER function delegation problem

(0) ShareShare
ReportReport
Posted on by 256

Hello,

 

I would like to get rid of the delegation warning when using FILTER function on a SharePoint list.

 

Basically, I need to avoid duplicate values for some fields (like Phone Number or Email Address) when adding new records or modifying existing records.

 

So, I try to CountRows over a Filter, avoiding the current record

 

DelegationNOT.png

 

But in this case the "<>" (not equal) operation seems that cannot be delegated even I'm using a numeric data type column.

 

According to Microsoft documentation Power Apps delegable functions and operations for SharePoint it seems that "<>" can be delegated for a numeric column except when the SharePoint ID is involved and in this case only "=" is supported for delegation.

 

But using "=" is even worse - the entire formula gets highlighted:

 

DelegationEquals.png

 

I try to avoid to create a collection at form opening because it might take a lot of time adding/modifying a record and other users could enter data that could break the uniqueness requirement.

 

Is it possible to avoid the delegation warning?... or I just have to ignore it?

 

Kind Regards,

Lucian

 

 

Categories:
I have the same question (0)
  • KvB1 Profile Picture
    1,596 on at

    Are you using the native ID assigned to an item by sharepoint itself or is this a column that you created?

  • Lucian Profile Picture
    256 on at

    Hi @KvB1 ,

     

    I'm using the native ID. I did not create that ID column.

     

    Kind Regards,

    Lucian

  • KvB1 Profile Picture
    1,596 on at

    I think the CountRows function is not delegable. This means that if you would ask PowerApps to count a number of rows that is larger than 2000, it will simply return 2000. 

    Would it be possible for you to do a LookUp instead? If i understand correctly your goal is to make sure there are no records with a certain value in the sharepoint list, but excluding the current record? 

    In that case if the LookUp returns anything, you know that there is atleast one row which holds duplicate information excluding your current item. Is that sufficient, or do you really need to know how many rows hold duplicate records?

  • Verified answer
    CU-18081211-6 Profile Picture
    9,270 Moderator on at

    @Lucian ,

    Check for the duplicate values on OnChange property of the control where you collect the sensible values. 

    Example, for email adresses - use the OnChange property to check if in the list there is already registered the current email adress with something like:

    UpdateContext(
     {emailDuplicateFound:
     !IsBlank(
     LookUp(yourlist,emailColumn=ControlForForm.Text)
     ) 
     }
    )

     You can set the display mode of the submit button to disabled if emailDuplicateFound is true.

     

    Hope it helps !

  • Lucian Profile Picture
    256 on at

    Hello!

     

    @gabibalaban thank you for your suggestion, but this approach is possible only for new records, for existing records LookUp function will hit the current item, so I will get a "false positive".

     

    Trying to avoid the current item, will get me the same warning as before.

     

    Lookup.png

    @KvB1 - you are right - it seems that CountRows cannot be delegated, but in this case I cannot understand why the delegation highlighted only the "ID<>" part from the Filter function.

     

    It seems that the only thing I could do is to hope for the best and the "Planned" status of this ideea - Extend delegation to Sum and CountRows - would be soon changed to "Done" 😁.

     

    Or just ignore the warning as the list should not reach 2000 items in the near future...

     

    Kind Regards,

    Lucian

  • KvB1 Profile Picture
    1,596 on at

    @Lucian 
    You are almost there, all you have to do is say !ID=ThisItem.ID instead of ID<>ThisItem.ID, and you shouldnt get any delegation error.

  • Lucian Profile Picture
    256 on at

    Hi @KvB1 ,

     

    Unfortunately it seems that any "negation" cannot be delegated (according to Microsoft documentation) 😞

     

    Negation.png

  • KvB1 Profile Picture
    1,596 on at

    I couldn't find that in documentation. It does seem that IsBlank( definately isnt delegatable. 

     

    You could try Len(LookUp(WhatYouHave).Title)>0. This should also return true if a record already exists that matches your LookUp requirement

  • CU-18081211-6 Profile Picture
    9,270 Moderator on at

    @Lucian 

    Take a thought, we talk about OnChange property and this suppose that the value is changed …

  • Lucian Profile Picture
    256 on at

    Hi @gabibalaban ,

     

    Sorry, my mistake - I have all the "error logic" into the "ErrorMessage" label and missed your mention to the OnChange property.

    Putting the uniqueness check into OnChange property and updating an variable used in the ErrorMessage label it seems to work and this way will avoid that delegation warning.

     

    Thank you.

     

    Lucian

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard