Documentos de Académico
Documentos de Profesional
Documentos de Cultura
0 0
Go To
Thank you for completing your profile. Your username is: bemvilacbrito.
Hi Fellow PowerAppsers!
This article is the first of a serie called Deep Dive into Delegation, where I try to
deeply explain how it works and how to workaround with different datasources
(SharePoint, SQL, CDS)
1. What is it exactly?
Everyone who have work on some medium to advance scenario in PowerApps have
probaly heard about delegation, at least on this warning.
https://powerusers.microsoft.com/t5/PowerApps-Community-Blog/Deep-Dive-Into-Delegation-What-Is-It-Exactly/ba-p/181456 1/13
21/04/2019 Deep Dive Into Delegation - What Is It Exactly ? - Power Platform Community
The first thing to do to understand what is this mysterious thing, is to look at this
article from the PowerApps documentation that provides a good overview of what is
delegation.
What is it ?
One of the strength of PowerApps is all it's connectors that let you build apps around
powerfull data systems, the most famous are Excel, SharePoint, SQL and the Common
Data Service (CDS). The delegation is a PowerApps feature that makes possible to
handle a large set of data within your apps while maintaining decents performances
and resources consumption.
When you're building an app, you can directly interact with your data source to
display a list of items (or records, or entries,...) or an item informations. What is
happenning is that, when it is possible, PowerApps will delegate the process of
retrieving data to the datasource itself, making the datasource retrieve small sets of
data to ensure performance consistence. When the user requests more data, for
example by scrolling down the list of items in a Gallery, the datasource provides
another small set of data to PowerApps to be displayed. You can see the phenomen
happenning when you scrolldown a gallery plug on a SharePoint list, the loading dots
appear on the top of the app, meaning that more data are being loaded from the
datasource. We can even quantify the small sets of data retrieved by the datasource
by using a Label to display this number.
By scrolling down, I'm telling my app that I want to see more data from my
datasource, so 100 more items are retrieve by SharePoint.
https://powerusers.microsoft.com/t5/PowerApps-Community-Blog/Deep-Dive-Into-Delegation-What-Is-It-Exactly/ba-p/181456 2/13
21/04/2019 Deep Dive Into Delegation - What Is It Exactly ? - Power Platform Community
I can scroll over all my 2000 items without having any performance issue because
SharePoint has retrieved them step by step.
SQL
Dynamics 365
Salesforce
If you plan to work with a lot of data (more than 2000), you can only consider
working with the datasources listed above. It is not (yet?) possible with others.
So what happens when my datasource is not delegable ? I'll use the same data but
this time in an Excel file, so PowerApps won't be able to delegate the retrieving of
data.
https://powerusers.microsoft.com/t5/PowerApps-Community-Blog/Deep-Dive-Into-Delegation-What-Is-It-Exactly/ba-p/181456 3/13
21/04/2019 Deep Dive Into Delegation - What Is It Exactly ? - Power Platform Community
This is where the "delegation limit" appears. Knowing that the datasource I'm using
can't handle delegation, PowerApps has loaded, locally, in my apps internal
temporary storage, a small amount of data : The first 500 items retrieved. Everytime
I'll reference my Excel datasource, I will always look only at these 500 items, even if
2000 items are stored in my Excel table.
Data are not loaded step by step (100 items at a time), I have directly access to the
500 first items of my table (because this is the sample stored locally), but I can't scroll
down to see more than these 500 items.
If you are working with a large set of data, you'll be able to use only delegable
operations (functions and operators). Just as PowerApps delegates the process of
retrieving data step by step to the datasource, it will delegate as well all functions and
operators you might use to retrieve your data.
https://powerusers.microsoft.com/t5/PowerApps-Community-Blog/Deep-Dive-Into-Delegation-What-Is-It-Exactly/ba-p/181456 4/13
21/04/2019 Deep Dive Into Delegation - What Is It Exactly ? - Power Platform Community
To know exactly which operations can be delegated to each DataSource, [this article]
is the reference.
For example, PowerApps can delegate a Filter function to SharePoint but only with
"=" operator.
Back to my SharePoint list, I will filter all expenses with the title "Lunch".
I have in total 490 items with "Lunch" as a Title and I can see that a first small data set
has been retrieved by SharePoint. SharePoint itself perform the filter on its own data,
and retrieve the results to PowerApps.
https://powerusers.microsoft.com/t5/PowerApps-Community-Blog/Deep-Dive-Into-Delegation-What-Is-It-Exactly/ba-p/181456 5/13
21/04/2019 Deep Dive Into Delegation - What Is It Exactly ? - Power Platform Community
After scrolling down, I'm able to go through all my items, retrieved small set per small
set by the delegation in SharePoint.
Now, what happen if the formula I wrote can't be delegated ? As soon as I'm using a
function or an operator that can't be delegated, I'm falling down in the case of a non-
delegable DataSource. Meaning that PowerApps will load locally the first 500 items
and perform the non-delegable operation on that set of data only.
For example, PowerApps can delegate a Filter function to SharePoint but not the "in"
operator.
On my SharePoint list, if I want to display all requests that Title contains "nch" (like in
"Lunch"), I'll face a delegation issue.
Because my formula can't be delegated, PowerApps reacts by loading locally the 500
first items and operates the filter on these set of data ONLY.
In total I have 490 requests that contain "nch" in their Title, but only 177 of them are
on the first 500 items of my list. And this is exactly what my gallery displays.
Common misunderstanding
One of the biggest misunderstanding I can see is using a local PowerApps Collection
to avoid delegation issue.
In fact, by doing so you avoid delegation warning, but not the issue. Collections can't
handle delegation (as it's a set of data stored locally), so collecting items from a big
delegable datasource won't change anything because your collection will only
contains the 500 first items of the DataSource. It is during the ClearCollect() function
https://powerusers.microsoft.com/t5/PowerApps-Community-Blog/Deep-Dive-Into-Delegation-What-Is-It-Exactly/ba-p/181456 6/13
21/04/2019 Deep Dive Into Delegation - What Is It Exactly ? - Power Platform Community
that the delegation issue appears, resulting that only the 500 first items are
retrieved. And of course no delegation warning when using a non delegable function
on a collection because there is absolutely zero delegation when performing
operations on local data, but you will just perform that operation on a limited set of
data.
On the next articles of this series, now that the concept of delegation is cristal clear,
I'll go deeper on the delegation issues you may encounter with the most common
datasources, and how to workaround them.
Feel free to comment or DM me if some aspects of the delegation are not clear.
Théo
Add tags
6 Comment
Comments
Hey @tchin-nin
great article! I wish to read it 2 weeks ago when i really had to understand how
delegation works.
https://powerusers.microsoft.com/t5/PowerApps-Community-Blog/Deep-Dive-Into-Delegation-What-Is-It-Exactly/ba-p/181456 7/13
21/04/2019 Deep Dive Into Delegation - What Is It Exactly ? - Power Platform Community
- delegation is not about “how many data you need”. It’s about “how many data you
need to search through to get what you need”
1
Nice article.
I highly recommend using flow with stored procedures when using a SQL Server data
source. No need to decide what can and cannot be delegatable and limitless options
for filtering data, performance is significantly greater. It does carry the extra overhead
of flow, but leave data management code where it belongs, in SQL Server.
0
Comment
RICH TEXT
HTML PREVIEW
Photos Quote
Font Size
https://powerusers.microsoft.com/t5/PowerApps-Community-Blog/Deep-Dive-Into-Delegation-What-Is-It-Exactly/ba-p/181456 8/13
21/04/2019 Deep Dive Into Delegation - What Is It Exactly ? - Power Platform Community
Rich Text Area. Press ALT-F10 for toolbar and Escape to return to the editor.
Cancel Post Your Comment
audrieg
MindyJ
suvidha1
https://powerusers.microsoft.com/t5/PowerApps-Community-Blog/Deep-Dive-Into-Delegation-What-Is-It-Exactly/ba-p/181456 9/13
21/04/2019 Deep Dive Into Delegation - What Is It Exactly ? - Power Platform Community
See all ≫
Latest Articles
Latest Comments
NiravNvs on: Join us TOMORROW for the next PowerApps Community ...
Spencer on: How to use Azure Blob Storage and Azure SQL togeth...
panand99 on: How to dynamically create records from one master ...
bmarcowka on: Automatically Prefill City and State using Zip Cod...
Rick72 on: PowerApps Mentorship Awards 2018 - Live Jan 7th, 2...
Labels
ALM 1
https://powerusers.microsoft.com/t5/PowerApps-Community-Blog/Deep-Dive-Into-Delegation-What-Is-It-Exactly/ba-p/181456 10/13
21/04/2019 Deep Dive Into Delegation - What Is It Exactly ? - Power Platform Community
Approval email 1
azure sql 1
Barcode 1
best practices 2
Branding 2
Bulk Updates 1
calculated field 1
Canvas 1
Canvas apps 1
CDS 1
Next
Archives
03-31-2019 - 04-06-2019
03-24-2019 - 03-30-2019
03-17-2019 - 03-23-2019
03-10-2019 - 03-16-2019
03-03-2019 - 03-09-2019
02-24-2019 - 03-02-2019
02-10-2019 - 02-16-2019
02-03-2019 - 02-09-2019
01 27 2019 02 02 2019
https://powerusers.microsoft.com/t5/PowerApps-Community-Blog/Deep-Dive-Into-Delegation-What-Is-It-Exactly/ba-p/181456 11/13
21/04/2019 Deep Dive Into Delegation - What Is It Exactly ? - Power Platform Community
01-27-2019 - 02-02-2019
01-20-2019 - 01-26-2019
Power Platform
Power BI
PowerApps
Microsoft Flow
Sign in
Sign up
Browse
Sample apps
Services
Downloads
Studio
iOS
Android
Learn
Documentation
Support
Community
Give feedback
Blog
Partners
https://powerusers.microsoft.com/t5/PowerApps-Community-Blog/Deep-Dive-Into-Delegation-What-Is-It-Exactly/ba-p/181456 12/13
21/04/2019 Deep Dive Into Delegation - What Is It Exactly ? - Power Platform Community
© 2019 Microsoft
Terms of use
Trademarks
https://powerusers.microsoft.com/t5/PowerApps-Community-Blog/Deep-Dive-Into-Delegation-What-Is-It-Exactly/ba-p/181456 13/13