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,
Plz advice, how to remove this warning message?
I think the issue is in User().Email. Try to replace it with "firstname.lastname@example.org" and see if the warning is gone. If so then prepending Set(e, User().Email); to your formula and then replacing "...&& Register.Email = User().Email..."
with "...&& Register.Email = e..." should resolve the issue.
I guess the "Status" is the name of a Choice column. The warning shows because that the choice column(Status) is a complex field type and isn't delegable in SharePoint, which results in running your query locally (in the 500 rows).
Actually if you have items less than 500, then you do not need to worry about this warning. But if you did, I suggest that you whether using other column types like text/number to filter, or you can change this 500 number to 2000 by going to the File tab, selecting the App Settings in the left hand navigation pane, and looking under Experimental features. Here you will find the "Data row limit for non-delegable queries" setting which you can change from 1 to 2000. This setting is app wide. With care, you can increase this number to fit your scenario. Be aware that as you increase this number your app's performance may degrade, especially for wide tables with lots of columns.
Please see this post which lists all the supported delegatable predicates and functions for SharePoint.
I replaced User().Email with a dummy string "User().Email". However, the warning was still there. The warning, a blue squibble appears on the List column and not the value I am passing. For ex, in the following,
Register.Email = User().Email
warning appears on Register.Email
And this is happening for both the fields which are complex,
For choice field where I am comparing Status.value with a string, the same warning pops up. Normal data types,
is working just fine. Plz advice.
Thanks for your reply @v-monli-msft.
Yes, Status is of type Choice. However, it's our internal column managed by MS Flow. So, if I replace it with a string type then, I think the filter should be executed at SharePoint itself.
Currently, the items in the List are less than 500 but, over time it is supposed to surpass this number. Which is why I wanted the filter to be delegated to SharePoint. Because, even if the List has 2000 items, our PowerApps is expected to deal with 5-10 items max. Increasing the limit will work but will slow down the app unnecessarily.
Which is why I wanted to understand is there a way to delegate the User filter to SharePoint as well? I am only using these 2 types. Changing the the choice to string might solve the first part but how to manage the User filter then?
You should be able to assign the User-related values to variables and them using them in your formula. That should address the warning. For example, pre-pend the following to your formula:
... and then replace User().Email with e in your formula.
I have tried both the ways,
Still, the warning persist. If you see in the image I provided in my last reply, the blue squibble appears on my SharePoint field and not on User().Email. So, no matter what I place on the right of the equal sign, the blue squibble is constant on the left.
@v-monli-msft mentioned that, this might be because my SharePoint field is complex, People field (I have also highligted Choice field in my code snippet which he pointed out)! If that is the case, I am wondering how to handle it for a People field and delegate the filter on the source.
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.
You are correct 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:
(StatusValueActual = "Add new" || StatusValueActual = "Rejected") && RegisterEmailActual = User().Email
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 if you have plenty of users and your dataset is not large or you have enough spare Flows per month/year.
I am getting the same error. We have a list to record customer feedback and have an app to add and view feedback.
The app has a gallery control on which we are doing a FILTER as part of the search functionality. The query we are using is:
txt_SearchInput.Text in 'Title',
txt_SearchInput.Text in 'Call Time',
txt_SearchInput.Text in 'Consultant Manager',
txt_SearchInput.Text in 'Consultant Title',
txt_SearchInput.Text in 'Consultant Name'.DisplayName
'Created By'.Email=LoggedInUser// the variable I created to avoid using User().Email
The warning I am getting is : "Delegation Warning. The highlighted part of this formula might not work correctly with column "Title" on large data sets."
If I remove the "in" statement for 'Title', the rest of the OR comparisons stay highlighted and the error message then mentions the next column. If I remove everything from OR, the email comparison gets highlighted.
Thanks in advance!