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

Delegation Confusion

Apologies if this question has been asked before but I'm having a hard time getting my head around delegation in PowerApps.

 

I've looked at this link and from what I can see the StartsWith and In filter functions are delgable.  I have created a PowerApp that connects to a couple of lists in SharePoint and have created a simple search screen consisting of a text box, button and gallery.  The idea is that the user enters text, clicks the button and then the gallery is filtered based on their input.

 

I have tested this with both of the functions below:

 

ClearCollect(TaskSearchColl,Filter(Tasks,StartsWith(Address,txtSearch.Text)))
ClearCollect(TaskSearchColl,Filter(Tasks,txtSearch.Text in Address))

 

The first function displays no delegation warning but the second one highlights the in with a blue line and displays the standard delegation warning.

 

What's really confusing me though is that the first function, even though it's not disaplying a delegation warning is having an issue.  I used the method mentioned here to set the data row limit for non-delegable queries for my app to 1.  However, when I use the first function only one item is returned even though multiple items match the search?  From my understanding, if the filter is delegable then it should return all matching items as the non-delegable row limit should not come into play?

 

Can anyone confirm whether what I'm seeing is right and whether I'm just of the wrong understanding when it comes to delegation?  The Microsoft documentation seems to be clear on what is delegable and what isn't but this doesn't seem to match with my testing.

 

Thanks in advance for your help.

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Delegation Confusion

Hi @gj84uw ,

For your first question, currently within PowerApps, the 'in' operator is not delegated within SP connector. Please check the following article for more details:

https://docs.microsoft.com/en-us/connectors/sharepointonline/#powerapps-delegable-functions-and-oper...

 

For your second question, I have made a test on my side, and don't have the issue that you mentioned, the StartsWith() function works well on my side. Even when I set the "Data row limit for non-delegable queries" option to 1, the StartsWith() function could also return all matched records.

Please check the following GIF screenshot for more details:Test.gif

Note: The StartsWith() function would search records whose specific column value begins with the search text from your SP List.

On your side, please do not save the the filtered result into a Collection, you could type your Filter formula within the Items property of your Gallery directly:9.JPG

On your side, please set the Items property of your Gallery to following:

Filter(Tasks, StartsWith(Address, txtSearch.Text))

Note: Please make sure the Address column is a Text type column in your SP list. The Collection is not a Delegated data source within PowerApps, the Collection data is stored within your App memory, the "Data row limit for Non-delegable queries" option would affect the Collection data disaplyed within your app.

 

More details about the StartsWith function, please check the following article:

StartsWith function

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Dual Super User
Dual Super User

Re: Delegation Confusion

Take a look at this link which has further information about delegation specifically in SharePoint.

https://docs.microsoft.com/en-us/connectors/sharepointonline/

 

In answer to your first question.  Startswith is delegable in SharePoint, but in isn't.  Startswith only searches the beginning of the text field, in searches all of the text field. Startswith wouldn't find 'are' in SharePoint, but in would.

 

In terms of your other question I think the terminology in the article is misleading. I'm pretty sure the limit applies whether the function is delegable or not.  Whether something is delegable or not doesn't change that you can only return a max of 500 records. Its just the delegable can return up to 500 from a much larger dataset, but non-delagable will only return based on the first 500 no matter how many there are.  So if you set the max to 1 you will limit the return to only 1 even if you use a delegable function.  There is really no reason to set that value to less than 500. Also, delegation doesn't make any difference if the data source has less than the maximum number of records returnable (ie. 500 by default). Delegation only becomes important for larger data sets.

 

 



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Community Support Team
Community Support Team

Re: Delegation Confusion

Hi @gj84uw ,

For your first question, currently within PowerApps, the 'in' operator is not delegated within SP connector. Please check the following article for more details:

https://docs.microsoft.com/en-us/connectors/sharepointonline/#powerapps-delegable-functions-and-oper...

 

For your second question, I have made a test on my side, and don't have the issue that you mentioned, the StartsWith() function works well on my side. Even when I set the "Data row limit for non-delegable queries" option to 1, the StartsWith() function could also return all matched records.

Please check the following GIF screenshot for more details:Test.gif

Note: The StartsWith() function would search records whose specific column value begins with the search text from your SP List.

On your side, please do not save the the filtered result into a Collection, you could type your Filter formula within the Items property of your Gallery directly:9.JPG

On your side, please set the Items property of your Gallery to following:

Filter(Tasks, StartsWith(Address, txtSearch.Text))

Note: Please make sure the Address column is a Text type column in your SP list. The Collection is not a Delegated data source within PowerApps, the Collection data is stored within your App memory, the "Data row limit for Non-delegable queries" option would affect the Collection data disaplyed within your app.

 

More details about the StartsWith function, please check the following article:

StartsWith function

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,663)