10 Performance Tips for Microsoft Power Apps

10 Performance Tips for Microsoft Power Apps

Eric Gregorich

Power Apps is a fantastic tool for building low-code applications for businesses. Your application's performance is one of the critical factors for success. A well-performing application can mean the difference between failure and success. Imagine you are a user in the field collecting data for an inspection. You load your app, fill in some data, and then wait. You can't move to the next task until your data is sent to the server and the subsequent screen loads. How frustrating!

Here are several tips that have helped me when developing complex Power Apps applications.

  • Limit your app to 500 controls.
  • Limit your app to 30 data connections.
  • Cache data using variables.
  • Save data to the device.
  • Use the concurrent function.
  • Use DelayedLoad.
  • Republish your app regularly.
  • Reuse formulas from other controls.
  • Optimize your data source.
  • Maintain your data gateway.

Let's dig into the details.

Limit your App

Limit your app to 500 controls: The more controls you have in your app, the more resources the app uses to generate the HTML document object model. The larger the object model, the slower the app.

Limit your app to 30 data connections: Every connection increases the amount of time the app takes to start. Also, when the app runs, each connector requires resources from the users' computer as the app requests data from the data source.

Cache data using variables

Rather than making multiple calls to a data source, you can cache your results into a variable. Then reference the variable instead.

Save data to the device.

Saving your data to the device can drastically increase performance because you don't need to make unnecessary calls to the database.

Save your data to the device using the SaveData function.

SaveData(collectionName, "collectionName");

Now you can load your data using the LoadData function.

LoadData(collectionName", "collectionName");

You can also clear the data on the device using the ClearData function.

Use the Concurrent function to load data in your Power App simultaneously.

Suppose you are pulling data from multiple data sources into your Power App. Whether it is from SharePoint, SQL, or any other data source, you can drastically speed up the load time by loading the data simultaneously rather than executing one call after the other.

In theory, if calling each data source takes 1 second and you have 5 data sources, you can load the data in 1 second instead of 5 seconds. This can really add up!

Use Delayed Load when you have more than ten screens.

App performance can suffer if you do not have Delayed Load enabled because the controls from all screens must populate even when that screen is not open. Each screen also updates when the data source changes. Using Delayed Load will load the data when the screen is opened by the user.

Republish your apps regularly

You will want to republish your apps regularly so that they get the latest optimizations from Microsoft.

Reuse formulas from other controls

Rather than repeating the same formula across multiple control properties, you can add the formula to one control and reference that property from the other controls.

For example, if you have a formula in the ControlA.Visible property, you can have ControlB.Visible = ControlA.Visible. You can then manage your formula in the ControlA.Visible property and it will automatically update everywhere.

Another option is to set your formula to a variable on the Screen.OnVisible property. This option would work well if the formula is not pulling from the values of the controls themselves but instead from another data source.

Optimize your Data Source

When you are working with data sources, there are several things you need to consider regarding performance.

  • Delegation: Power Apps minimizes the data moving over the network; therefore, it limits how much data is processed at once. By default, it is 500 records, but you can increase it in App Settings to 2000 records. I recommend you review this documentation to understand Delegation.
  • Limit the data to what you need: Whether connecting to SharePoint or SQL, limit the number of columns you return Especially dynamic columns such as lookups, person or group, and calculated columns.
  • Ensure your using the correct data types: Filter('Data Source', ID = 123) is delegable if the ID field is an integer. However, Filter('Data Source', ID = "123") is not delegable.
  • Do the work at the data source: Create Views that handle Joins, Group, and Sorting. Return only the columns and data that you need.
  • Use a StartsWith operator instead of an In operator in your formulas. The StartsWith uses an index seek, where the IN operator results in a table scan.

Maintain your Data Gateway

Your Data Gateway allows your Power Apps, Power BI, or Power Automate to connect to your SQL Data Source. Setting up the gateway is as simple as installing it and logging in. Here are some tips for maintaining it.

  • Keep your gateway up to date: Microsoft releases an update to the Data Gateway every month, which contains performance and security improvements.
  • Keep your gateway close to your data: Your gateway needs to communicate with SQL, so keeping it close to your data will make a difference. Install your gateway on the SQL box or a server with direct access to SQL with minimal network latency.
  • Use multiple gateways: A data gateway can handle 200 concurrent connections. It sounds like a lot, but when you have many users using the app, each making multiple calls to the database can quickly be reached. Install multiple gateways and configure them as a mesh to distribute the load.
  • Monitor your gateway performance: There are tools for monitoring your gateway's performance to determine if there are slow queries or errors.

Further Reading

Common canvas apps performance issues and resolutions - Power Apps
Learn about the common performance issues and resolutions for canvas apps.
Understand delegation in a canvas app - Power Apps
Use delegation to process large data sets efficiently in a canvas app.
Monitor and optimize on-premises data gateway performance
This article provides ways for you to monitor and optimize the performance of the on-premises data gateway activities.
Considerations for optimized performance in Power Apps
Recommendations on how to maximize performance of your Power Apps
Tips to improve canvas app performance - Power Apps
Follow the best practices in this topic to boost the performance of canvas apps that you create in Power Apps.

If you enjoyed this article, please share it with others. You can also reach me on Twitter @ericgregorich or send me an email if you have any questions or suggestions.