We all know the importance of being organized; Being organized improves productivity, reduce stress, improves time management, enhances focus, improves decision-making and so on. When you’re organized, you can work more efficiently and stay focused on the task at hand. In Power Apps you can stay organizined by using a naming convention.
What is a naming convention?
A naming convention is simply a set of rules for naming things. There are different naming conventions for Power Apps, but in my opinion… the only thing that truly matters is that one exists and that it’s used consistently!
Why having a naming convention matters?
Having a clear and consistent naming convention makes it easier to navigate and understand the purpose of each element in your app. It can also make it easier to identify and resolve issues with the app, as well as increase collaboration among team members, since everyone is working with a shared understanding of the naming structure.
By having a well-defined naming convention in place, you can ensure that your Power App is well-structured, maintainable, and scalable, which can help you save time and resources in the long run 🥰
Easy naming convention for Power Apps
Disclaimer: This is my preferred naming convention. It’s adapted from this white paper by Microsoft; PowerApps canvas app coding standards and guidelines. Feel free to adjust according to your own preferences!
Choose a case style
First things first; choose a case style for your naming convention! Camel case and Pascal case are two popular case styles used in programming.
Camel case is a style where the first letter of the first word is lowercase and the first letter of the following word is uppercase. For example, “firstName” or “employeeId”. Pascal case is a style where the first letter of each word is uppercase. For example, “FirstName” or “EmployeeId”.
The main difference between the two is the capitalization of the first letter of each word in the name.
However, my preferred method is Snake Case; Snake case is a style where each word in a compound name is separated by an underscore. For example, “First_Name” or “Employee_ID”. I use snake case, because it makes control names more clear, readable, and easier to understand.
But whatever case style you end up coosing, be consistent with it. In other words, don’t name some controls with camel case and some with snake case.
Screen names in Power Apps should clearly describe what the screen is used for. This makes it easier to navigate the app in edit mode. It’s important to use simple language, no abbreviations, and include spaces in the name.
A well-named control makes it easier to understand the purpose of the control, and helps to keep the app organized. To name controls effectively, use names that accurately describe the control’s function and keep them simple.
To further clarify the type of control, prefix the name with the control type. Below is a list of the most common controls and their prefixes:
|Shapes (rectangle etc.)||shp|
Below is an example of how control names should look in Power Apps. Please note that this is only for demo purposes so the names are not as descriptive as they could be.
Collections are used to store and manage data. To make sure collections are easy to identify and use, it’s important to have a clear and consistent naming convention for them as well.
I always start collection names with the prefix “col”. It makes it’s easy to know what’s a collection and what’s not. With collection names I prefer to use camel case instead of snake case and I try to choose a short and descriptive name for each of them.
I prefer to handle variable names the same way as collection names. This is my way to differentiate controls from these more abstract things.
Groups help you organize your controls and make the app more managable. I usually group all elements that clearly belong together, for example controls for a confirmation dialogue, but I don’t create groups just for the sake of creating groups. Groups make it easy to move controls around, and it’s especially handy when you want to change the order of your elements.
Groups, like everything else, should have descriptive names and start with a prefix.
Be consistent with your naming convention
Whatever naming convention you end up adopting, be consistent with it and use it as you build your apps. If you try to implement a naming convention as an afterthought, it can be a surprisingly tedious job. The best way is to make a habit out of it; when you get used to it, it becomes second nature.
PS: Check out my previous blog post: Naming convention for Power Automate.
Interested in reading our latest Power Platform blog posts?
You’re welcome to subscribe to our email newsletter: Forward Forever News. Max 1 email per month, with a curated list of latest insights and articles on Power Apps, Power Automate, Power BI.