2022 Power Apps Coding Standards For Canvas Apps

2022 Power Apps Coding Standards For Canvas Apps

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 2022 that includes all of the latest features
  • These coding standards can be continuously improved as new Power Apps features hit “general availability” in 2023, 2024, 2025 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

  1. ๐Ÿ”  Naming Conventions
  2. ๐Ÿ“ฆ Variable Types
  3. ๐Ÿ“ Commenting Code
  4. โš™ Canvas App Settings
  5. ๐Ÿ”Ž Reviewing Canvas Apps
  1. ๐ŸŽจ App Theming
  2. ๐Ÿ“‹ Form Design & UX Guidelines
  3. ๐Ÿ–ผ Gallery Design & UX Guidelines
  4. ๐Ÿž Error-Handling
  5. โšก Optimizing Performance
  6. ๐Ÿ‘“ Improving Code Readability



Additional Sections

  • ๐ŸŒณ Change Log – tracks all updates made to the coding standards



Questions?

If you have any questions about 2022 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.

Subscribe
Notify of
guest
32 Comments
Oldest
Newest
Inline Feedbacks
View all comments
Amy
Amy
2 months ago

Awesome sauce ๐Ÿ˜

lRohit Wattamwar
lRohit Wattamwar
2 months ago

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

Ankur
2 months ago

I mean…this is awesome Matthew! Like really awesome.

Gerard
Gerard
2 months ago

This is an epic share – much appreciated ๐Ÿ‘

Daniel
Daniel
2 months ago

Really nice.
Awesome job. Thanks a lot for you work and sharing

Ajit Sharma
Ajit Sharma
2 months ago

Thanks Matthew for sharing, its awsum to have all details at one place.

Sharon L
Sharon L
2 months ago

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!

Md. Hidayat
2 months ago

Thank you for putting this together!!

Andrรฉs
Andrรฉs
2 months ago

Matthew did it again.

Thank u for such awesome document.

Reiner Knudsen
Reiner Knudsen
2 months ago

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.

Sarath Subramaniam
2 months ago

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).

Ibrahim
Ibrahim
2 months ago

Weldone for this selfless service to PowerAddicts

Kurt
Kurt
1 month ago

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.

pgsm
pgsm
1 month ago

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
pgsm
1 month ago

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.

Last edited 1 month ago by pgsm
Andrew A
Andrew A
18 days ago

Absolutely amazing!!

pgsm
pgsm
5 days ago

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