cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
piyush
Level: Powered On

Delegation warning. This part "Filter" of this formula might not work correctly on large data sets.

I have a PowerApp which uses SharePoint List as its data source. The app is working fine. However, a hazard icon is now appearing over my button which has a filter query on OnSelect with the following message,

Delegation warning. This part "Filter" of this formula might not work correctly on large data sets. The data source might not be able to process the formula and might return an incomplete data set. Your application might not return correct results or behave correctly if the data set is incomplete.

I am using the following query,

Refresh('SpList'); Set(filteredItems, Filter('SpList', (Status.Value = "Add new" Or Status.Value = "Rejected") && Register.Email = User().Email)); 
Navigate(scrnDocPending,ScreenTransition.Cover)

This is what I am trying to achieve in the above code,

  • Refresh the SharePoint data source, SpList, for new values.
  • Filter and store the result in a global object, filteredItems.
  • Navigate to a new screen.
  • In the new screen, I am using this object, filteredItems, as a data source of a gallery.

Plz advice, how to remove this warning message?

3 REPLIES 3
AMerrill
Level 8

Re: Delegation warning. This part "Filter" of this formula might not work correctly on lar

SPO is having trouble delegating the condition

     Register.Email = User().Email

User().Email, despite being a constant for any given user is not picked up by Sharepoint that way (or maybe PowerApps). The simplest way around this problem is to go the first screen on your app and select the OnStart property. Insert the following bit of code:

     Set(var_Email,User().Email)

Now replace in your code User().Email with var_Email. The delegation error should go away.

Highlighted
meet1
Level: Powered On

Re: Delegation warning. This part "Filter" of this formula might not work correctly on lar

I tried but it gives me same warning

Super User
Super User

Re: Delegation warning. This part "Filter" of this formula might not work correctly on lar

Hi @piyush

 

The issues you've been facing are not to do with the User().Email function - this is client-side and not part of the delegation issue.

 

Regarding the 'squiggle lines' indicating the delegation issue is due to the SharePoint field and not the User().Email - at this current point in time People picker is not a delegable item (neither are any choice or other items which involve .Value / .Id / .anything )

 

A workaround for this would be to create a new Text Column and maybe call it StatusValueActual, then have a flow set up which sets the value for these to Status.Value

 - This new column will now be Delegable

 

Now that you've solved that, you will now likely encounter that Register.Email is also not delegable - follow the same steps as above to create RegisterEmailActual, then you could re-write your code as follows:

 

Refresh('SpList');
Set(
filteredItems,
Filter(
'SpList',
(StatusValueActual = "Add new" || StatusValueActual = "Rejected") && RegisterEmailActual = User().Email
)
);
Navigate(scrnDocPending,ScreenTransition.Cover)

 

What I also like to do (if your users are only using an app and will never see the SP list), is to have this field(s) set from the app during every Edit/New action once you have all of the existing fields filled via Flow. This is to reduce the number of Flows used, however this is not a requirement is you have plenty of users and your dataset is not large or you have enough spare Flows per month/year.

 

Cheers,

ManCat




Don't forget to 'Mark as Solution' and 'Thumbs Up' those who deserve it!

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Users Online
Currently online: 55 members 4,859 guests
Please welcome our newest community members: