Tim Coalson is a Senior Consultant in the Transformation Practice at ThreeWill. Tim has been developing solutions on the SharePoint platform for over 15 years and has been a developer/consultant for over 30 years. Tim has been involved in migrating SharePoint on-premises farms to the Microsoft Cloud, Power Apps, and Power Automate (aka Flow) which are part of the Microsoft no code/low code solutions.
I know that YOU probably don’t need to debug a Power App. Your code always works. But, perhaps, you might have a “friend” or co-worker who needs help, so maybe you can share this post with them!
I learned about the Monitor a while back. It’s a great tool to monitor and debug calls to your data source or at least that is the main way I have used it.
Follow These Steps to Debug in Power Apps
You can launch Monitor under the Advanced Tools menu
The monitor is similar to “Fiddler” for Power Apps in that you can view the api calls that are taking place behind the scenes.
Filter by Data Source
Here’s an example where I’ve filtered by the Data source column to show all activity against the “hours” data source which happens to be a SharePoint List in this scenario.
I can drill into the details of a specific row by clicking on the row where I can see four tabs of information: Details, Formula, Request and Response. In this example, the Request tab shows me the query that was sent to the data source so I can confirm that it retrieved data for the correct user and for the correct date.
On the left pane, I can see that 3 rows were retrieved.
The Response tab shows me the data that was retrieved either in a tabular format or a json format.
Response in tabular format:
Response in json format:
So, this was all great in and of itself and then I was watching another video today, Top 10 Tips for Debugging Power Apps & Power Automate and learned about the Trace statement. This is functionality I have been looking for but had not found. Basically, the Trace function allows you to explicitly write out debug information to the Monitor.
So, for example, if I want to see the value of a date, I can add a Trace function to my code to write out this value to the Monitor.
Trace function in code
So, then I get this output in the Monitor
Trace output in Monitor
While this certainly doesn’t rival real-time debugging in Visual Studio, it is definitely beneficial if you (or your friend) are trying to track down a bug.
I can only imagine that the debug capabilities will only continue to mature as the Power Platform continues to grow. If ThreeWill can assist you as you get started with development using Power Apps and Power Automate and help soften the learning curve, please reach out to us. We’d like to help your organization realize the full value of your investment in the Microsoft Cloud.
CONTACT THREEWILL TODAY TO EXPLORE HOW YOU CAN SOLVE BUSINESS PROBLEMS WITH THE POWER PLATFORM!