Tip for Naming Components in Power Apps

OK, so you’ve been working with PowerApps for a while, right?

Long enough that you have a little bit of a naming model for your controls. You’ve decided on whether you are using the Petzold model or the Pascal model, or the javascript model. (Did I just out myself as an old guy?)

Well, it’s pretty easy in PowerApps to keep controls straight, because you always refer to them by their name, and naming is unique with an app, right? Right.

I mean – a Name is a Name, right?

But then, PowerApps releases some new “experimental” capabilities, namely, ‘Components’.

Components introduce a pretty interesting concept called a ‘custom property’.  These are defined and exposed variables that are exposed as parameters, if you will, – as input or output parameters.

Here’s the tip – and if you grok this, it might save you the almost two (2) hours of debug time that it would have saved me. (Yes, I’m a lousy debugger – I don’t really get much practice. (take that to mean what you will.))

For each custom property, there are two versions of the name…  a Display name and a Name. The ‘Name’ is the equivalent to the control.name that we’ve been using in every other part of PowerApps. The difference now is that instead of the ‘Name’ being the one that’s displayed, the “Display name” is the one that is displayed, and there is nothing that guarantees that the Display name and the “name” are the same…

So, now you have to refer to a named customer property within a component via the name, which isn’t the display name. And if you don’t, well, your mileage may vary.

To view/edit the Display name and the Name for a customer property, after it has been created, click the hyperlinked datatype name to the right of the custom property.

OK. Enjoy, and good luck. And, in the words of Eric Thomas, “Until next time, keep making it Appin”.