Blog

Troubleshooting - How to use the 'app checker' to fix a broken 'service desk' template app

When an app stops working, we can use the 'app checker'  to review the errors. To demonstrate how this works, this post describes the errors that can occur when template apps become outdated, and walks through the process of troubleshooting how to fix an app with this tool.

Introduction to template apps

Power Apps offers a selection of template apps that provide a great way to learn about Power Apps, and povide a basis for further customisation.


What problems are there with these template apps?

There are a few issues with apps that we build from a template. Typically, we want to build apps that can save data to a data source. We can configure an app to use an Excel data source, but we need to create the app from Power Apps Studio in order to specify the spreadsheet location.
https://powerusers.microsoft.com/t5/Building-Power-Apps/PATApp-Fail/td-p/386094

However, the bigger problem is that the designer hides the data panel. This makes it impossible to refresh the data source, and therefore makes it impossible to add additional data sources to a template app, or to add additional columns to existing tables.

To restore the data panel, we can extract the source code, modify the manifest settings, and to rebuild the app. Unfortunately, this is not a simple process for beginners, but for further details, my post describes this process in detail:
http://powerappsguide.com/blog/post/code-manifest-file-unhide-data-panel

The second problem is that Power Apps platform and language syntax changes over time. There have been occasions in the past when template apps have not kept up with platform changes, which have resulted in periods where the apps that we build from templates are broken.

To minimise the overhead of maintaining template apps, it seems that Microsoft have withdraw template apps, particularly those where telemetry indicates that they are not widely used. This is unfortunate because we've lost some great apps, a notable one being the 'employee suggestion' app.
https://powerusers.microsoft.com/t5/Building-Power-Apps/Where-can-I-find-PowerApps-Suggestion-Box-template/td-p/590336

As a point of reference, this excerpt from my book in 2017 describes 4 template apps that are no longer available.

How to use the 'app checker' to fix the broken app

At the time of writing, an update to Power Apps has broken the service desk template. Although this is frustrating, it provides an opportunity to walk through how to diagnose and fix problems with the help of the 'app checker' tool.

When we create an app based on the service desk template, many errors appear throughout the app. To fix these errors, the first step is to click the app checker icon at the top of the screen. This opens a panel on the right-hand side that summarises all the errors in the app. We can work through and fix each of these errors.

From the 'app checker', we see that most of the errors appear on the 'tickets page'. There are 14 errors in total, and 9 appear on this page.


The errors on the ticket page relate to controls on a gallery template. The syntax that refers to data fields are no longer valid. The correct syntax now is to prefix the data fields with the ThisItem keyword. Adding this prefix to each data field reference fixes the problem.


With the example that is shown above, we prefix 'AssignedTo' with the ThisItem keyword like so.

If(IsBlank(ThisItem.AssignedTo),"None",ThisItem.AssignedTo)
As the screenshot beneath shows, we can use the 'app checker' to navigate to all the labels that are missing the ThisItem keyword, and to resolve the errors.


Next, we use the 'app checker' to move on to the "filter page". Here, we see the error - "Name isn't valid. This identifier isn't recognized".

Again, the reason for this error is because the label control is inside a gallery, and we need to change the syntax to include the ThisItem keyword like so:
ThisItem.Filter_x0020_By
The remaining errors occur on the status, assign, area, and priority pages. They all follow the same pattern and relate to the missing ThisItem keyword. Once we fix all of these errors, the app will work as expected.

Conclusion

This post covered the topic of template apps and the 'app chekcer' tool. When platform changes occur, the formulas in template apps can become out of sync with the new expected syntax. This post walked through the process of how to troubleshoot problems by using the app checker tool.