Reverse Engineering The COE Theme Editor Taught Me Something New

Brendon Colburn
2 min readMar 22, 2021

For those who are not familiar with the Center of Excellence Starter Kit and it’s standalone theming solution I’d recommend you start here:

Set up the Power Apps theming solution — Power Platform | Microsoft Docs

The BLUF is that the theming solution can be used to establish a theme for your PowerApps to include backgrounds, custom fonts, and the controls themselves on generation. After trying it out, I thought it was great but it also sparked my curiosity; I wanted to know how it was overriding the default PowerApps behavior when generating new controls on a canvas. So I started digging and this is what I found:

PASopa.exe extracts out Canvas Apps into source code to include it’s default theme behavior, can you spot the difference?

I used PASopa.exe to unpack two canvas apps, one of them was blank and the other one was generated by the COE Theme Editor as an App Template. What I learned was that the templatized version modified Themes.json so that the defined values in the palette leverages variables instead of being hard-coded. You can then set the value of these variables on start of the App, as shown below, and it will dictate how all controls will render themselves in that app.

Canvas App on start behavior shown in VS Code that sets theme variables using Dataverse as a data source
Canvas App OnStart behavior that sets theme variables using Dataverse as a data source

You may be asking yourself at this point “This is great, Brendon, but what does it buy me knowing this?” I would argue that the pursuit of knowledge itself is a noble one, but I also try to be pragmatic at heart… You can leverage this information to create your own app templates that make apps look how you want them to, in a way that is potentially more advanced than what is provided out of the box with the COE Starter Kit. This isn’t meant to knock the offering. The naming convention of a ‘starter kit’ implies that there are improvements and iteration that can be performed on the approach. It’s my goal to help provide the community with the insights necessary to start that iteration and improvement!

I hope you liked and found value in this blog entry. Have an excellent first week of spring!

--

--