PowerApps Rocks!

Name All The Things!

Why are PowerApps naming conventions important?

PowerApps autogenerates a name for each Control as its added to the screen. Its imperative that you override the autogenerated name with a standard naming convention that is agreed upon (and documented!) within your org.

The top 3 reasons for adopting a standard naming convention for all PowerApps development:

  1. Maintainability
  2. Code readability
  3. Intellisense!

Maintainability and Code Readability

These two go hand-in-hand. Consider this, an app has 8 buttons. The PowerApps autogenerated name for each button is Button1, Button2 etc. for each button added.

Without a naming standard in place for Controls and Objects, there is no at-a-glance understanding of what is happening in the code.

Example:

  • Is TESTTHISTHING a Variable or a Collection?
  • What do Button1/5/8 refer to?
  • Do you remember what each Control does?
  • You'd have to select each button and see which one lights up in the hierarchy view on the left... what a pain
  • If you inherit an app with no naming convention, good luck, you'll likely need to reverse engineer the whole thing.
Switch(TESTTHISTHING.column1,
    "Feel Lucky?",
        Select(Button1),
    "Feel Lucky??",
        Select(Button5),
    "Feel Lucky???",
        Select(Button8)
    "Remember me???",
        Select(Button2)
)

This looks so much better!

  • Code based on Controls with logical names is maintainable.
  • HINT: Name Controls as the app is built to avoid pain as the app gets bigger and more complex!
Switch(varTestThisThing.goodStandard,
    "Feel Lucky?",
        Select(btnPleaseNo),
    "Feel Lucky??",
        Select(btnEject),
    "Feel Lucky???",
        Select(btnNew)
    "Remember me???",
        Select(btnStop)
)

Take it a step further and group the similar Controls

Clean...

...and collapsable

Intellisense

When you implement a clean and standardized naming convention, PowerApps' built-in Intellisense becomes even more useful.

Lets look at the same example as before. If I have a solid naming convention in place, and I begin writing the Switch() statement from above... Look at what happens when I'm ready to call one of my Button Controls.

I start typing btn and all Buttons in my app become available below the Function window.

This is sweeeeet! By hitting the down arrow on the keyboard then Tab, I can select the Button I need to reference and keep truckin'. If the Buttons were not named according to any standard, I'd have to find the button in the app, click on it, and see which Control lights up in the Tree View on the left (boo!).

Hopefully these examples convey just how important this is for Low Code Developers. If you are going to take PowerApps seriously, establish and communicate a naming convention for all Controls and Objects.

Below is the standard I use. Feel free to take the best elements and build them into your own PowerApps!


PowerApps.Rocks! Naming Conventions

Control Name
Screen scrTest
Label lblTest
Button btnTest
Textbox txtTest
Dropdown ddTest
Combobox cmbTest
Checkbox chkTest
Toggle tglTest
HTML Text htmlTest
Pen Input penTest
Datepicker dtTest
Radio btn rdoTest
Timer tmrTest
Form frmTest
Image imgTest
Camera camTest
Barcode scanner barTest
Icon icnTest
Component cmpTest
Custom property cstTest
Object Name
Variable varTest
Collection colTest
Tags:
powerapps | standards |