Understanding Delegation in Microsoft PowerApps: A Guide
Bildquelle: Shutterstock.com
Power Apps
28. Sept 2023 18:54

Understanding Delegation in Microsoft PowerApps: A Guide

von HubSite 365 über Amit Kumar Rath

Senior Consultant at Capgemini Nederland B.V. (Dynamics365 CE/Power Platform)

Citizen DeveloperPower SelectionPower AppsLearning Selection

Optimize PowerApps performance using Delegation - Understand delegable functions, non-delegable functions and explore practical delegation examples.

In Amit Kumar Rath's recent blog post, he discusses the issue of Power Apps slowing down due to heavy manipulation and filtration of large datasets. He suggests a solution to this problem lies in making effective use of Delegation. More about Power Apps.

Delegation, he explains, is the process where tasks are assigned to data sources rather than carried out by PowerApps. This can be particularly useful when handling large datasets for it limits the records being sent between PowerApps and the data source. Currently, some data sources support this process: SharePoint, SQL Server, Dataverse, SalesForce.

The blog post outlines the functions which can be delegated, among those are 'StartsWith', 'Filter', 'Lookup', 'Sort', 'Max', and 'Min'. Additionally, Rath highlights the non-delegable functions. These include 'Choices', 'CountRows', 'Concat', 'CountIf', 'RemoveIf', 'UpdateIf' and a few others.

Delegation Examples in Practice

The blog post provides several examples of delegation utilization with SharePoint listing over 5000 records.

An issue with 'Search' can be alleviated by replacing it with 'StartsWith', a delegable function. When a search function was applied to search products by the product name, a delegation warning showed. This warning was avoided by using 'StartsWith' instead.

Another problem is with filtering based on Choice columns. To avoid a delegation warning for Status column filter, Rath recommends storing possible statuses in a collection, which should serve as a dropdown filter.

In order to sort a gallery without triggering a delegation warning, Rath recommends using a 'Switch' function. This function can help to sort based on the Price and Expiry date.

Another case Rath tackles in his post is finding Max and Min values and Sum of a column. He points out that typical ways to find Max, Min, and Sum are not delegable – however there is a workaround by using collections, Power Automate and Rest API.

And lastly the author provides solutions for counting rows of large datasets without raising delegation issues by using a collection in the 'CountRows' function.

Power Apps: Speeding Performance with Delegation

Overall, the blog post sheds light on the concept of Delegation in Power Apps, and how it can enhance the app's performance when dealing with large datasets. This is achieved by having tasks performed by data sources rather than relying solely on the app itself. The post also presents a series of instructive examples to illustrate how to resolve common delegation warnings.

Read the full article PowerApps Delegation

Power Apps - Understanding Delegation in Microsoft PowerApps: A Guide

Learn about PowerApps Delegation

The topic at hand introduces Microsoft's PowerApps, specifically emphasizing on Delegation. PowerApps is an outstanding tool for creating business apps quickly, but handling extensive datasets might cause the software to slow down. This burden is lessened by leveraging the strategy of Delegation.

Delegation, within the context of PowerApps, is the transfer of specified tasks to the data sources to be handled instead of having Power Apps process them. This strategy proves essential when dealing with massive datasets to minimize the number of records transferred between PowerApps and the data source. It's worth noting that currently, Delegation is only supported by specified data sources, such as SharePoint, SQL Server, Dataverse, and Salesforce.

Some functions in Power Apps support Delegation and are therefore referred to as Delegable functions. Examples include ‘StartsWith’, ‘Filter’, ‘Lookup’, ‘Sort’, ‘Max/Min’. On the contrary, there are also non-delegable functions, such as 'FirstN', 'Last', 'LastN', 'CountRows', 'CountIf', 'RemoveIf', and 'UpdateIf', amongst others, that cannot leverage Delegation.

In dealing with large datasets, such as SharePoint lists with more than 5000 records, using delegates proves advantageous. Some situations exemplifying this are:

  • Using 'StartsWith' to replace ‘Search’ function in coding to cease Delegation warnings.
  • Storing 'Status' choices in a collection for dropdown search – this avoids Delegation warnings while applying filter on certain columns.
  • Utilizing a ‘Switch’ function when sorting data to avoid Delegation warnings.
  • Calculating Max and Min values without generating Delegation warnings by writing certain formulae.
  • The utilization of collections to circumvent Delegation issues with the 'Sum' function.
  • Counting rows without Delegation warnings by using the 'CountRows' function with a collection.

By following the techniques mentioned above, problems arising due to extensive manipulation and filtration of large datasets in PowerApps can be managed more effectively. Thus, Delegation not just improves the performance but also the usability and efficiency of crafted PowerApps software.

Wrap up: PowerApps is indeed a potent tool that efficiently handles large datasets using Delegation, considerably speeding up business operations and enhancing productivity.

Learn more about PowerApps Delegation at PowerCloud Technologies.

More links on about PowerApps Delegation

Understand delegation in a canvas app - Power Apps
Feb 6, 2023 — Delegation is where the expressiveness of Power Apps formulas meets the need to minimize data moving over the network. In short, Power Apps will ...
SharePoint Delegation Cheat Sheet For Power Apps
Feb 5, 2023 — This SharePoint delegation cheat sheet is the quickest way to check which Power Apps functions support delegation.

Keywords

PowerApps Delegation, PowerApps Delegation Limits, PowerApps Delegation SharePoint, Delegation in PowerApps, PowerApps Large Data Delegation, PowerApps Delegation SQL, Delegation Warning PowerApps, PowerApps Delegation 500, PowerApps Delegation Filters, PowerApps Delegation Examples