Skip to main content

Notifications

Power Apps Best Practices

This guide covers the 11 best practices you need to optimize your canvas apps.

  1. Enable Loading Spinner for galleries
    Loading Spinners indicate to users that content is still being loaded, reducing confusion or likelihood of leaving the page.
    In the Gallery panel, under the Advanced tab, change LoadingSpinner.None to LoadingSpinner.Controls or LoadingSpinner.Data based on your needs.

    maqsoftware_2-1669616392118.png

  2. If using more than 20 images, insert them as HTML text
    Images uploaded through the Media panel increase the app’s load time. If using more than 20 images, insert them as HTML text to minimize load. For example: Uploading 25 images through the Media panel results in a 3-second load time, whereas uploading 25 images using a tag result in a 1-second load time.
    Go to Insert > Text > HTML text and enter “< img src='INSERT HYPERLINK'>” in the formula bar.

    maqsoftware_4-1669617664591.png

  3. Create components for common elements
    To save time and unify design across screens or apps, create components for frequently used elements like headers and footers. This enables you to easily reuse elements so you don’t need to recreate them.
    In the Tree view pane, go to Components > +New component and build your component.

    maqsoftware_6-1669617766527.png

  4.  Use Concurrent function if formula execution is nonsequential
    If you have more than one formula in no particular sequence, evaluate the formulas using the Concurrent function. The Concurrent function evaluates multiple formulas simultaneously, enabling your app to load data faster.

    maqsoftware_7-1669617882350.png

  5. Use delegable calls over non-delegable calls

    When calling data sources, some functions are delegable while others are not. Delegable functions are evaluated on the server with higher performance. Non-delegable functions require the data be downloaded to the client and evaluated locally. This process is slower and more data-intensive than a delegable call.

    maqsoftware_0-1669618777220.png


  6. Use IfError for exception handling
    The IfError function tests values for errors. If the function finds an error, it replaces the error with a valid value so downstream calculations can continue without delay.
    IfError is a Power Apps experimental feature and is turned off by default. To enable it, go to Settings > Upcoming features > Experimental and turn on “Formula-level error management”. Once it’s enabled, enter IfError(1/0, Notify(“Error has occurred”, Error), Notify(“Success”, Success)) in the formula bar.

    maqsoftware_8-1669618006828.png

  7. Store data in a collection
    To avoid repeated calls to the data source (which takes more time), store data in a collection or use the Set function to cache data from the lookup tables locally and then use it everywhere inside the app.

    maqsoftware_9-1669618065904.png
  8. Use a global variable or collection to share information between screens
    To avoid control dependencies, use a global variable or collection to share information between screens.
    Example: Do not use ‘Gallery.selected.columnName’ in screens other than where this gallery exists. Instead store this value in a global variable i.e., Set(galData, Gallery.selected.columnName) and then use this variable.

    maqsoftware_10-1669618117691.png

  9. Use combo boxes instead of drop downs
    Combo boxes are a combination of a search bar and a drop down. They enable users to search for items or view items by category, instead of having to scroll through long traditional drop down lists.
    To add a combo box, go to Insert > Input > Combo Box

    maqsoftware_11-1669618172140.png

  10.  Use themes
    A theme defines the design properties for controls and components such as colors, fonts, and borders.
    Using themes enables you to maintain design consistency across your app.
    Under the Home tab, use the Theme drop down to choose a theme.

    maqsoftware_13-1669618255616.png

  11. Limit code inside the OnStart property
    Limit the code within the OnStart property to improve the debug process and use StartScreen property to prevent complex, long-running formulas in App. OnStart can significantly slow the startup time of an app.

     

    maqsoftware_1-1669618891415.png

     

    References

Comments

*This post is locked for comments

  • bh7 Profile Picture bh7 3
    Posted at
    Power Apps Best Practices

    Article's screen shot image quality is poor.

  • fnanfne Profile Picture fnanfne 260
    Posted at
    Power Apps Best Practices

    Regarding #9.

     

    Only use combo boxes over dropdowns when there are a lot of choices. 

     

    Combo boxes can have some annoying issues, from displaying, patching or even in flows.

  • rnwood Profile Picture rnwood
    Posted at
    Power Apps Best Practices

    For 7 IMO, context variables should be preferred wherever possible. Only use global variables and collections where they are truly required. Context variables can be used to pass parameters to screens and they can be used instead of collections in many cases. Their advantage is that they are scoped to one screen only.

  • Akrama Profile Picture Akrama
    Posted at
    Power Apps Best Practices

    This is very helpful. Thank you

  • Power Apps Best Practices

    Good for aspiring developers who want to build their base strong. Must be recommended through out all the organizations that are using Power Apps as a tool

  • Power Apps Best Practices

    Insightful!

  • Syed_Akrama Profile Picture Syed_Akrama
    Posted at
    Power Apps Best Practices

    Insightful read. Thank you for sharing this

  • AmanShukla Profile Picture AmanShukla
    Posted at
    Power Apps Best Practices

    Insightful 

  • pulkitlnu Profile Picture pulkitlnu
    Posted at
    Power Apps Best Practices

    Best practices to remember while creating the next canvas app.

  • nonamAman Profile Picture nonamAman
    Posted at
    Power Apps Best Practices

    Amazing Writeup and very useful post🙌