The Power Apps Code Review tool. If you’re developing canvas apps, this is THE tool you need to be using to check how good your app is. It covers lots of recommendations around coding standards, accessibility and more.
The been around for a while now, but still seems to have gone under the radar for a lot of people I encounter. So in the interests of spreading knowledge & experience, this article will cover what it is and how to use it. It’s made me a much better canvas app developer as a result of continued use, so hope it does the same for you.
Table of Contents
ToggleIntro
The Power Apps Code Review tool was released by Microsoft in 2021. The initial release article (here) explains that it uses the Power App Language Library to process your canvas apps and give you lots of useful insights. The tool will score your app in different development areas and provide any recommendations for making things better.
The key thing to keep in mind is that the tool won’t automatically fix things for you, nor will it be right every time. There may be times when you disagree with the recommendations, or agree but there’s no better option. The tool gives us opportunity to log these kind of comments so we can keep track.
Pre-requisites
To use the Power Apps Code Review tool, first you’ll need access to an environment where you can install two Power Platform solutions. Before you can install either of them, you’ll need to make sure the environment is set to allow the Power Apps component framework.Â
Enable Component Framework
Head over to the Power Platform Admin Centre – https://aka.ms/ppac.Â
Select the environment you want to install the two solutions into, then click on Settings:
Expand Product and click on Features:
Scroll down and toggle the ‘Power Apps component framework for canvas apps’ feature to On:
Make sure you scroll down to the bottom of the screen and click Save.Â
Install the Creator Kit
You’ll need to grab the files from GitHub. Click here to go to the latest releases, at the bottom of each release are the relevant .zip files:
As a minimum, you’ll need to import the ‘Core’ solution package. The ‘References’ solutions are optional, but I’d recommend one of them as gives you great insight into each component in the kit.
If you’re unsure how to import a solution, please visit this Microsoft Learn article.
You'll need a license too
As the Power Apps Code Review tool stores information in Dataverse tables, you’ll need to ensure all users are, or will be licensed accordingly with a Power Apps per app or premium licence. This wasn’t the case when the tool was first launched but is a pre-requisite now. Thanks to Daniel in the comments for confirming.
Import the Code Review Tool solution
With the Component Framework enabled & Creator Kit installed, now you’re ready to import the Power Apps Code Review Tool solution!
The latest files and further information are on GitHub, available here. If you already have it installed, make sure you’re using the latest version available. At time of writing, that’s version 1_0_0_133:
You don’t need both solutions; one is unmanaged (you can edit it), the other is managed (you can’t edit it). Download whichever best suits your needs, then import the solution into the chosen environment.
When installed, you’ll see two new apps. To start a new Power Apps code review, you’ll need to play the Power Apps Review Tool canvas app:
Start a new review
In the app, click on New in the top left hand corner. This will present a modal for you to fill in:
If you know your accessibility stuff when it comes to designing canvas apps, you’ll know modals are bad. They aren’t compatible with screen reader technology, as explained in this MS Learn article:
I thought I’d double check that the modal above is accessible and indeed it is. Microsoft have injected a code component that implements an accessible dialog/modal.
In the popup form, give your review a name. It’s optional to add a customer, I’d recommend it to keep track of what review relates to what customer/department/project. In the Select an app to review section, it’ll typically find apps in the same environment as the Power Apps Code Review Tool solution. If you can’t find the app you want, simply upload a solution or isolated .msapp file.
The really cool thing about uploading a solution – if it contains multiple canvas apps and/or custom pages, the tool will review each one, then provide a per-app and overall score.
If you’ve followed my blog from day 1, you’ll know I built an app for my wife and her business. I’ll use that for my code review:
Click on Submit in the bottom right of the form, then let the app do its thing. It may take a while to finish processing, depending on the size of the app/solution.
Analyse a review
When processing has finished, you’ll see a tick and Review be displayed to the right of the entry. Click on Review to load the initial details. The score achieved will be displayed, you can click on Review again to access the details:
88%, not bad. I’ve certainly had lower scores when putting an app through the tool 😂.
Code review checklist
The Code Review Checklist is the first page to load. Here it will provide some details for key patterns and whether they’ve passed or failed the review. I use ‘failed’ cautiously here; these are recommendations – good ones, and more often than not something you can review and learn from. But, it may also flag things that can’t be done any other way (to your knowledge).
To the right of each line, you can click View Details to see additional information. In my code review, I’m on the naughty step for nested operations:
The details are really cool, because it tells me what screen, control and property the ‘offence’ is taking place. It also shows me the code it’s questioning. The details can potentially show multiple instances so be sure to scroll to the bottom for all the information.
Hhmmmm, it’s flagged that I’m doing a Search/Filter directly against a Dataverse view. Maybe I could load that as a collection instead if it’s static data? Or maybe it needs to stay as it is – it’s your call:
It’s worth noting that if you really want to, you can mark each FAIL as a PASS, but what’s the point in that? If you can justify the FAIL, maybe have an internal standard to mark the item as NA and add a comment to that affect:
Another gem on the this screen is the email icon in the top right hand corner. Click it to get the full checklist output sent to your mailbox. It’s nicely formatted and, pass or fail, it still provides all the reference links for you:
App checker results
This screen of the Power Apps Code Review tool shows you the same results you’ll find in App Checker when in the Power Apps studio:
If App Checker picks anything up that needs checking, normally the icon above is accompanied by a red circle to grab your attention. However, I find on occasion this doesn’t happen so it’s easy to forget to check. The Code Review tool brings through the same information, so expect to see things around accessibility, performance and unused variables. Clearly I have some cleaning up to do in my wife’s solution!
App overview
There’s a bunch of really useful information here. The screen is broken down into a set of micro-summaries about your app.
Back on the Code Review Checklist screen, App Setting Flags are shown with a pass or fail. I think personally this is a bit aggressive to mark these as Fail, some of these settings might be in preview or simply optional. For example, the Explicit Column Selection setting is great to enable, but also VERY frustrating to work with as a developer:
My advice here is not to simply enable all of the suggested settings on the App Overview screen. Go into the app and look/read into the settings and enable ones you think are relevant. Remember that preview features aren’t recommended for production apps:
I’m not sure some of these are even available to turn on & off anymore, so keep that in mind too.
The other massive part I want to point out on the App Overview screen is the numbers in the bottom left. These give you a count of controls per screen. App Checker used to suggest that we should have no more than 300 controls per screen, though I think that’s since been raised to 500. Keep in mind that the more controls your screens have, the longer they’ll take to render and the more memory consumed. This is especially important when building responsive apps and needing endless containers. Controls can quickly add up and cause performance issues.
If the Power Apps Code Review tool shows that you have lots of screens with 500+ controls, you might want to consider breaking the app out into multiple, smaller apps instead. Building components is also a good idea.
Code viewer
When the Power Apps Code Review tool was first released, this screen was gold dust. It was the only place where you could find where a collection was being built. You could do that in Power Apps studio for variables, but not collections. These days we have the search/find/replace functionality which is great, so maybe less use for this screen now.Â
Code review results
One of my favourite screens in the app, as it gives a very quick high-level view of your score, and areas to focus:
As I work through the suggested fixes or mark things as NA with comments, the score & suggestions will change. I like being able to track improvements I’m making so this screen is usually the first one I go to and keep record of for each pass of the app or custom page.
Using internally
Here’s my top 5 tips for using the Power Apps Code Review tool in your organisation:
1- Review routinely, not just at the end:Â Review your developments at the end of a sprint or working week. Keep on top of recommendations & don’t leave potential changes all to the end. Take screenshots of the dashboard and include as part of your release notes, handovers or technical documentation to keep track of changes.
2- It’s not a beating stick:Â If someone reviews an app and the score comes out really low – GOOD! Embrace it, then use the feedback to learn and hone your craft. Don’t use low scores to make others feel bad (I’ve seen it happen too many times). In fact, seeing a score go from 20% to 80% is VERY satisfying. No-one is perfect.
3- It’s not a silver bullet:Â The tool is good, but it’s not going to recognise everything that needs fixing. Features are released quicker than the Power Apps Code Review tool is updated, so keep that in mind. For example, the tool won’t suggest using Named Formulas.
4- It’s a supplement, not a substitute, for peer reviews:Â In my opinion, there’s no better code review tool than the knowledgeable eyes of someone else. Let others review your app for code improvements and other best practices. A person is more likely to be up to date with new features or niche techniques that will get the best out of your app – and improve your skills at the same time.
5- Keep your reviews:Â It’s easy to delete code reviews if no longer needed, however they provide good insight for new starters, keeps a history of changes or comments made and good to compare multiple reviews for the same app.Â
What are your experiences with the Power Apps Code Review tool? I’d love to know so feel free to comment below.
If you liked this article and want to receive more helpful tips about the Power Platform every week, don’t forget to subscribe or follow me on socials 😊
Hi there
Great write up. I have a question, do you need a premium license to run this? I can’t seen to find this anywhere.
Cheers
Hi Daniel, great question! It’s Dataverse driven so would assume you need licenses to use. If you can’t license everyone, you can possibly funnel requests for usage via a ticketing system. Dedicated users could then start a review and provide the outputs back to the requester.
Great, I’m going to take it for a run in my test tenant and if it works then then I’ll apply it to our real one. I got some 30+ canvas apps (and will grow more if I build a CRM system – would need premium anyways for dataverse) so it will be interesting to see how bad some of those apps are.
Let me know how you get on, I’m keen to see if you can use as intended without a Premium license. I also never like to think how “bad” apps are, but more “what opportunities will it recommend to make them better”
So I just got it running in my test tenant and I got the message (In part) “The user with object identifier ” in tenant ‘ does not have a plan with sufficient policies to use premium APIs. Premium APIs used by the app: shared_commondataservice,shared_commondataserviceforapps”
So there you have it, a premium license is needed.
Thanks Daniel, that’s very interesting to know.
The prerequisites for the Creator Kit (https://learn.microsoft.com/en-us/power-platform/guidance/creator-kit/setup):
“Prerequisites
A Microsoft Power Platform environment with a Dataverse database
The Power Apps code components for Canvas apps feature enabled (the System Administrator security role is needed to enable the feature).
The System Customizer security role is needed to use the Creator Kit components.
A Power Apps for Microsoft 365 license.”
“A Power Apps for Microsoft 365 licence” – delightfully vague. The wording on this should be tightened up to specify ‘Power Apps Premium’ (previously known as Power Apps Per User (etc)) to help users.
Craig, perhaps this could be fed back via your MVP channels 😉 ?
I’m using the Creator Kit in several tenants that doesn’t have Power Apps Premium, it’s the app review tool that needs Power Apps Premium.