Get to grips with how to best name your canvas app objects
Published on January 29, 2024 by Emil Rydell
Power Platform Canvas app Model-driven app Solutions
3 min READ
As you create objects in your PowerApps apps, it’s important to use consistent naming conventions for screens, controls, and data sources. This approach will make your apps easier to maintain, can help improve accessibility, and will make your code easier to read as those objects are referenced.
This section describes “camel case” and “Pascal case” naming conventions. If you’re already familiar with those terms, you can skip ahead.
Use camel case for controls and variables. Camel case begins with a lowercase, removes all spaces and capitalizes the first letter of each word after the first word. For example, a label might be named lblHeader.
Use Pascal case for data sources. Like camel case, it removes spaces and capitalizes the first letter of each words. However Pascal case also capitalizes the first word. For example, a common data source in PowerApps is the Microsoft Office 365 Users connector, which is named Office365Users in your code.
Screen names should reflect the purpose of the screen, so that it’s easier to navigate through complex apps in PowerApps Studio.
All control names on the canvas should use camel case. They should begin with a three-character type descriptor, followed by the purpose of the control.
Control name Abbreviation button btn component cmp screen scr camera control cam canvas can card crd combo box cmb dates dte drop down drp form frm gallery gal group grp header page shape hdr html text htm icon ico image img label lbl page section shape sec shapes(rect, circle) shp table data tbl text input txt timer tim checkbox cbx named formula nfo container cnt hor container vert container
When you add a data source to your application, the name can’t be changed in the PowerApps app. The name is inherited from the source connector or data entities that are derived from the connection. Here are some examples:
As you add code to your PowerApps apps, it becomes increasingly important to use consistent naming conventions for variables and collections. If variables are named correctly, you should be able to quickly discern the type, purpose, and scope of each.
https://pahandsonlab.blob.core.windows.net/documents/PowerApps%20canvas%20app%20coding%20standards%20and%20guidelines.pdf