Welcome to the Power Apps Coding Standards For Canvas Apps.
In this guide you will find 50+ pages of coding rules, guidelines and best practices I use everyday to create Power Apps Canvas apps. I have spent the last 3 years building Power Apps every day. Now I want to share the knowledge I’ve gained in this set of easy-to-understand, actionable examples.
Power Apps already has an official set of canvas coding standards released back in 2018. So why did I make my own? A few reasons:
- I wanted an updated set of standards and guidelines for 2024 that includes all of the latest features
- These coding standards can be continuously improved as new Power Apps features hit “general availability” in 2025, 2026, 2027 and beyond
- Readers can leave comments on my website describing their own best practices which I can incorporate into future versions
I hope you enjoy my Power Apps Coding Standards For Canvas Apps.
Table Of Contents
- 🔠 Naming Conventions
- 📦 Variable Types
- 📝 Commenting Code
- ⚙ Canvas App Settings
- 🔎 Reviewing Canvas Apps
- 🎨 App Theming
- 📋 Form Design & UX Guidelines
- 🖼 Gallery Design & UX Guidelines
- 🐞 Error-Handling
- ⚡ Optimizing Performance
- Load Multiple Datasets Concurrently
- Write Formulas That Use Delegation
- Cache Data In Collections And Variables
- Limit The Size Of Collections
- “Batch Patch” Multiple Changes To A Datasource Table At Once
- Reduce Code In The App’s OnStart Property
- Minimize Number Of Controls On A Single Screen
- Enable DelayOutput For Text Input Controls
- Do Not Reference Controls On Other Screens
- Eliminate The N+1 Problem
- 👓 Improving Code Readability
- Apply Automatic Formatting
- Use The WITH Function
- Flatten Nested IF Functions
- Have A Consistent Naming Convention For Controls & Variables
- Join Text Strings And Variables
- Choose Consistent Logical Operators
- Remove IF Statements When The Result Is A True Or False Value
- Simplify Logical Comparisons When Evaluating A Boolean
- Substitute The Self Operator For The Current Control Name
- Alphabetize Patch & UpdateContext Function Arguments
Additional Sections
- 🌳 Change Log – tracks all updates made to the coding standards
Questions?
If you have any questions about 2023 Power Apps Coding Standards For Canvas Apps please leave a message in the comments section below. You can post using your email address and are not required to create an account to join the discussion.
Awesome sauce 😁
Amy,
Glad you like it. This is going to take a little bit longer to consume than my usual posts 😉
Hi Matthew,
Thanks for your fantastic work on PowerApps best practices work. Do you also have the best practices for data verse schema creations, from where PowerApps pulls data, like answers of a couple of questions below.
1. Creating a common, less complex schema for PowerApps as well as Power BI for reporting, i.e. how to handle multi selects in reporting.
2. How to create a multi select lookup columns, which data type to use to store and retrieve this information in power app
3. How to create multi select person column, irrespective of he or she is having power apps licence, they should be visible and selectable in drop down
4. How to handle a star schema like data model in power app, say 8 to 9 tables
5. How to reuse by default offering from data verse like, forms, views etc in canvas apps
6. How to work with business logics in data verse in canvas apps, the way it’s used in model driven apps.
Etc.
Regards,
Rohit
Rohit,
Data-modelling is a very broad topic and it falls outside the scope of these Canvas App standards. I do intend to do some Dataverse and Model-Driven app topics in the future. I also think your multiple selection for data/people question deserves a blog post as well.
I mean…this is awesome Matthew! Like really awesome.
Ankur,
Thanks buddy. I worked really hard on it!
This is an epic share – much appreciated 👍
Gerard,
I appreciate your message. Take care 🙂
Really nice.
Awesome job. Thanks a lot for you work and sharing
Daniel,
Yes, it was alot of work but its totally worth it. Enjoy 🙂
Thanks Matthew for sharing, its awsum to have all details at one place.
As a citizen developer, I’m not sure if you realise the absolute gift your guides and references are to the community. They are my go to every time I open Power Apps!
You are a legend!
Thank you for putting this together!!
Hidayat,
You’re welcome!
Matthew did it again.
Thank u for such awesome document.
Andres,
Yes, I hoped this would become one of my greatest hits and so far its on track. Thank you 😊
Thank you, my friend, for this invaluable gift. I already loved your posts, but this summary is a magnificent support for everyday app development. You are an absolute hero.
And I LOVE the frontpage picture.
Reiner,
You’re welcome. Now please come to Canada and work with me!
Thank you for sharing this, very useful. Can we also consider adding prefixes for variables inside the ‘With’ formula or the ones inside ForAll when using ‘As’?Something like var (variable), itr (iterator).
Sarath,
I have already adopted var as the prefix for variables inside the With function. See the section titled ‘Naming Conventions.’
Aliases can be used other places than just ForAll loops. Therefore, starting all aliases with itr might not be appropriate. You have given me something think about here…
Thanks for taking the time to write!
Weldone for this selfless service to PowerAddicts
Ibrahim,
Power Addicts forever!
Hi Matthew
Whenever I have to solve a very specific problem, I know there’s a Cat out there that provides an absolute goldmine of knowledge. Thank you for sharing.
Kurt,
I am forever your humble Power Apps ninja cat warrior 🐱👤 🤣
Thank you for taking the time to write me 😊
Mathew, should you link an Edit Form to a Gallery through Gallery.Selected? Or should you use a variable to hold the selected item and link the form to the variable? Thanks in advance.
PGSM,
I strongly recommend using a variable. I often reset the gallery when I leave the screen. When a gallery is reset it looses it’s selection.
I’m using a variable, too (varItemSelected). However I’m facing some difficulties. For instance:
What do you set your Gallery Default property to?
In my scenario, the form and gallery are in different screens. When I create a new record, the form flashes and the varItemSelected fills the form. This is not correct, since a new record can’t be the same that was previously selected in the gallery (the item property of the form is set to the variable varItemSelected). I can set the varItemSelected to Blank() when creating a new record, but then the form will show up empty after I create the record and I need the user to remain there since the user needs to use some custom controls to fill the whole record. So, to solve this, I’m setting the LastSubmit infomation to a variable in the OnSucess property of the form and then setting this variable to the gallery’s Default property. Then when I create a new record, I reset the gallery and the form gets filled with the newly created record. Could you tell me what you think about it? It seems too “hacky”, like i’m improvising. I don’t like it.
PGSM,
I suggest you follow this pattern described in my blog:
https://www.matthewdevaney.com/power-apps-form-modes-newform-editform-and-viewform/
Absolutely amazing!!
Andrew,
I’m glad you liked it
Greetings, Matthew,
Hey, do you know if it’s possible to prevent users from create a powerapp based on the list that has been shared with them?
It’s crazy. You put this huge amount of effort into creating user experiences, applying business rules, and there’s nothing stopping users from just creating a simple power app, adding a list and a form and bang, they can do as they please, if you don’t have stuff like item level security put in place, and even that won’t stop them from bypassing the rules or completely messing up their items in the list.
Thanks in advance
PSGM,
Sorry, but I don’t. That’s just the nature of working with SharePoint. It wasn’t purpose built for app making so you’ll continue to run into scenarios like these.
Using Dataverse as the datasource addresses these problems you’ve just mentioned. But it requires premium licensing, and therefore is not available to everyone. I, for one, would like to see an option like Dataverse For Teams but without the MS Teams requirement. Stand alone. I think that would be a good middle ground.
Wow Matthew,
I was reading your blog(site) for some time now, found there many useful things there. Started back when the design was the old one not this pink(ish) 🙂 and now subscribed and download your coding standards. And man. All this stuff in one place? A masterpiece. I got the knowledge in many areas also written down but not in one place. This is gold.
Thank you for your time and effort 🙂
Tomas
Excellent resource, thanks Matthew! 👏
Keith,
You’re welcome. Thanks for leaving a kind note 🙂
Thank you so much for having all this helpful info in one place!
Excellent Information, I was looking if you have information on Using Word Templates WITHOUT Premium Connectors on power app, my client has the power app free version. Thanks, in advance!
Awesome site and I know you’ve put a lot of effort and work into this. No doubt, your site and a few other Power App sites, or should I say training sites, have been a god-send to me and has been helping me out big time. Like the list of Power Apps functions, I haven’t seen that anywhere except for the Microsoft documentation but Microsoft has always been lame in that department, especially when SharePoint broke out with MOSS2007, or even with 2003. I always visit here first if I need something. Sometimes you don’t have what I need but you’re definitely a great resource and good place to start. You added much to the list of functions like you said it has been very helpful. Now you’ve provided us with this great write-up on best practices and I found delegation ironic, and inline with the true nature of connectionless web applications. With Power Apps it’s now explained a bit different but all the same but, probably a bit more important and more appreciated….lol
Thanks for all the info and help and keep up the great work.