How to improve debugging of a Canvas APP with the Monitor
Do you ever encounter problems with your Canvas apps during development?
We all encounter times when we have made an unwanted mistake.
When this happens we need a quick way to identify the nature of the problem.
If you need to debug a Canvas Power Apps you many times have to come up with something custom, e.g. using labels or notifications.
However, to do a more accurate job you need to use all the tools you have at your disposal and one of them is the monitor.
The monitor allows you to delve deeper into what is happening in your app.
This tool is indispensable whenever you have to deal with HTTP calls, especially if you are using custom connectors.
This is because you have the possibility to examine in detail the body of the request and of course also the response (this is not always a problem with your app but could also be a problem with the service).
To access the monitor, open the canvas app in edit mode and select open monitor from the advanced tools on the left-hand side.
After clicking in open monitor, a new page will open in the browser as shown in the following image.
At this point you are ready to record your app’s activities, and to do so you simply interact with your app and all actions will be recorded.
A very useful aspect of investigating what is going on is the use of the Trace() function.
There is often a lot of logic working behind the scenes in an app.
As I mentioned it can sometimes be difficult to visualise and understand what is going on inside the app.
By taking advantage of the Trace function you can record diagnostic information from behind the scenes, creating a timeline of what actually happened, to better understand how your app works and to help solve problems.
Furthermore, if you have allowed your app to send telemetry data to Azure Application Insights, the Trace function can also be used for this scenario.
For example by using the following function in the onSelect property of a :
You will see the following result on the monitor
This makes it easy to identify potential bottlenecks.
Clearly this tool does not solve all evils, but it is a powerful weapon you can use to improve your Power App Canvas.
You can also use the monitor to perform a performance analysis as you can easily read the time that a certain function or call takes.
Therefore, my advice is to use it all the time, start getting familiar with it by examining how the various requests are handled and use the filters to search more easily for the calls you want to monitor.
This makes debugging an app offline, for example, much easier!
I hope this article has helped you and enables you to debug your Power Apps more easily and quickly.