Power Apps Naming Convention Coding Standards
There are only two hard things in Computer Science: cache invalidation and naming things.
Table of content
Screen names
Screen names should reflect the purpose of the screen, so that it’s easier to navigate through complex apps in PowerApps Studio.
What’s less obvious is that screen names are read aloud by screen readers, which are needed for users who have vision accessibility needs. Therefore, it’s imperative that you use plain language to name your screens, and that the names include spaces and no abbreviations. Also, we recommend that you end the name with the word “Screen,” so that the context is understood when the name is announced.
Examples:
- Home Screen
- Setting Screen
- Inventory Screen
Control names
A control name should show the control-type, the purpose and the screen. Use camel-case and underscores for spacing. For example, the control named txt_FirstName_OrderForm
is a text input that captures first name on the app’s Order Form Screen.
I may not rename every single control that I put on a screen but I will rename a control if I'm going to reference it in a formula or another control.
These are common controls that I use in my day to day development.
Control name | Abbreviation |
---|---|
button | btn |
check box | chk |
combo box | cmb |
component | cmp |
container | con |
date picker | dte |
drop down | drp |
form | frm |
gallery | gal |
html text | htm |
icon | ico |
image | img |
label | lbl |
radio | rdo |
rating | rtg |
rich text editor | rte |
shapes | shp |
spinner (modern) | spn |
table data | tbl |
text input | txt |
timer | tmr |
toggle | tgl |
Variable names
I follow these simple rules when naming variables.
- Prefix context variables with
loc
. - Prefix global variables with
gbl
. - Seperate the variable type and the variable descriptor with an underscore.
- Descriptor using UpperCamelCase.
Examples
gbl_LoggedInUser
is a global variable who's value is the currently logged in user.loc_ItemToDelete
is a context variable who's value is the item that should be deleted.
Collection names
A collection name should contain the original datasource and describe it's purpose.
- Prefix collection names with
col_
- The datasource should be the abbreviation, followed by another underscore.
- Descriptor of the collection.
Example: col_Sp_FiscalYears
has a datasource of SharePoint and is a collection of fiscal years.
A standard list of datasource abbreviations can be found below:
Original Datasource | Abbreviation |
---|---|
Dataverse | Dv |
SharePoint | Sp |
SQL | Sql |
Salesforce | Sf |
None (created in-app) | (none) |
Datasource table names
A datasource created by the developer should have 1-3 words to describe its purpose. Be as concise and clear about the purpose of the datasource as possible.
Examples
- Employees
- Project Requests
- Sales Orders