In this article we will discuss PowerApps delegation, Delegable data sources and functions, and hw to overcome the delegation warning in PowerApps?
What is PowerApps Delegation?
Delegation is very important concept that you have to understand, specially when you will work with large data sets in PowerApps. First let’s know that delegate means to assign tasks to someone else.
PowerApps Delegation means when you work with the different data sources such as dataverse, SharePoint SQL Server ,etc, the data processing are assigned to data sources rather than done by PowerApps itself.This means Power Apps will retrieve small amount of data and this will speed the app and improving the user experience.
PowerApps Delegation limit
The default delegation limit in PowerApps is 500 records. Delegation does not apply to data sets with less than 500 records, they will work correctly without any issue. Also you can increase this limit to be up to 2000 records.
- Open your app
- Go to File Tab >> App settings
- Click on Advanced Settings.
- You can set the value: “the Data row limit for non-delegable queries” to be up to 2000 records.
But if your data sets exceed the limit that defined in your app, your app will work correctly with the first 500 records “Assume that the defined limit is 500”. but it will not work correctly with other recordes.
Ex: if you have 600 records in your data set and you want to retrieve the last 10 records, in this case it will return the record from 490 to 500 in stead of returning the correct records that from 590 to 600. So its important to understand the delegation if you want your app to work correclty.
PowerApps Delegable data sources
As we know there are many data sources that are supported to work with PowerApps , but not all of them are delegable, you will find few data sources that support delegation in PowerApps.These data sources support delegation process the data quit similar to what PowerApps do.
Some of the popular delegable data sources are:
- Dataverse ,
- SharePoint,
- SQL Server,
- Dynamics 365 (CRM)
- etc.
Unfortunately Excel data source not delegable, but it depends whether your excel file stored in the cloud or stored locally in the app.
If you stored your excel file in the OneDrive for Bussines for example, then you have to fetch the data source through the network traffic, in this case your Excel data source not supporting delegtaion.
But when you store your excel file locally in the app as a static data source, then you will not facing any PowerApps delegation problems, as there is no network traffic and your data is locally stored in the app itself.
When performing operations, like filtering or searching for specific records in PowerApps, they performed at the data source instead of bringing the whole set of data to the app and then processing it locally, so PowerApps delegation assign the work to the data source instead of the PowerApps itself.
Although you use delegable data sources,you get delegation warning, That’s because the delegation not only depends on the data sources but also it depends on the functions that you use in your formulas.
Delegable Functions
As there are delegable and non-delegable data sources, there are delegable and non-delegable functions.
For Example, Filter, Search,,LookUp, Sort, SortByColumns, Sum, Average, Min, and Max functions can be delegated.
AddColumns, DropColumns, RenameColumns, and ShowColumns partially support delegation.
For more details you can check Understand delegation in a canvas app.
How to overcome PowerApps delegation warning?
You will receive delegation warning if you use a function that is not yet supported by the data source.
You will see a blue line under parts of the code along with a warning triangle.
To Avoid the delegation warning,
- Be aware of which functions and operatives can be delegated back to the data source and how delegation works, so try to use all the possible Delegable functions.
- You can Change the 500 limit value up to 2000 as we discussed at the beginning of this article in the PowerApps Delegation limit section.
- If you have a large dataset, You can create some Static views instead of dealing with the whole data. For example, When using Dataverse table as a data source you can select a view instead of using the whole data source.
Conclusion
To Avoid the Delegation warning in PowerApps try wisely to use your data source, You can use SQL server, Dataverse or SharePoint, and you can increase the rows of your data by increasing the value above than 500 record.
No comments:
Post a Comment