Power Apps Best Practices
This guide covers the 13 best practices you need to optimize your canvas apps.
13 best practices to optimize your canvas apps
Loading spinners signal that content is still being loaded, reducing confusion or the likelihood of users leaving the page. Go to the Gallery panel > Advanced. Find LoadingSpinner and change LoadingSpinner.None to LoadingSpinner.Controls or LoadingSpinner.Data based on your needs.
Images uploaded through the Media panel increase the app's load time. For 20+ images, insert them as HTML text instead to minimize the load. Example: 25 images uploaded through the Media panel produced a 3-second load time, while 25 images inserted with <img> tags loaded in 1 second. Go to Insert > Text > HTML text and enter `<img src='INSERT HYPERLINK'>` in the formula bar.
To save time and unify design across screens or apps, create components for frequently used elements like headers and footers. Go to the Tree view pane > Components > +New component, then build your component as needed.
If you have more than one formula in no particular sequence, evaluate them with Concurrent(). It evaluates multiple formulas simultaneously so the app loads data faster.
Delegable functions are evaluated on the server with higher performance. Non-delegable functions require data to be downloaded to the client and evaluated locally — slower and more data-intensive.
IfError tests values for errors and replaces them with valid values so downstream calculations continue without delay. To enable it, go to Settings > Upcoming features > Experimental and turn on Formula-level error management. Example: `IfError(1/0, Notify('Error has occurred', Error), Notify('Success', Success))`.
Avoid repeated calls to data sources by storing data in a collection or caching values locally with the Set function, then reusing them throughout the app.
Avoid control dependencies across screens. Store gallery selections in a variable, e.g., `Set(varName, Gallery.Selected.columnName)`, or pass them in a `Navigate()` call: `Navigate(nextScreen, Screen Transition, {varName: Gallery.Selected.columnName})`.
Combo boxes combine a search bar with a drop-down, enabling users to search by category instead of scrolling through long lists. Go to Insert > Input > Combo Box, then build the combo box as needed.
A theme defines design properties for controls and components — colors, fonts, borders — and enables consistent design across your app. Under the Home tab, use the Theme drop-down to select a theme.
Limit code in OnStart to improve app load time. Avoid complex, long-running formulas and use Concurrent() wherever possible.
An automated Microsoft tool that analyzes the loaded canvas app against a predefined checklist, assigning pass/fail scores per item. Aim for a minimum score of 90% — 100% is not always necessary, since deviating from best practices is sometimes warranted, but always strive for the highest score possible.
Unpack an .msapp file to generate a single YAML file containing all the code for a particular screen. This lets developers review code top-to-bottom in Visual Studio Code rather than navigating through individual properties of canvas controls — the C# syntax highlighter works particularly well because Power Apps code shares similarities with C#.
References
- 11 best practices to optimize your canvas apps — MAQ Software
- Use theming components — Microsoft Docs, last updated February 14, 2022
- Understand delegation in a canvas app — Microsoft Docs, last updated February 6, 2022
- Tips and best practices to improve performance of canvas apps — Microsoft Docs, last updated January 13, 2022
Need a canvas-app performance review or component library? MAQ Software's Power Platform team can help.
Talk to our team
DAX Best Practice Guide
Improve your Power BI speed and functionality with our 22 DAX best practices.
Read More