Easy error reporting in Power Apps | Email a JSON of errors

July 30, 2025 by
Easy error reporting in Power Apps | Email a JSON of errors
Andrew Valenzuela
| No comments yet

TLDR

  • This is a simple solution: There's a lot you can do in terms of error handling.  This is just a guide to get the errors in an easy to read format.

A collection of errors!

Power Apps records errors, but only at the time they occur.  It is up to you to determine how to collect those errors and how to report them.

General outline of my favorite solution:

  1. Set App > OnError​ to collect errors as they happen.
  2. Covert those errors to JSON.
  3. Send an email with that file using Office365Outlook​ connector.

(1) Setting up the app to record errors.

Go to App​ and in the dropdown select OnError​.  Set this to collect the following:

  • FirstError​: This is most recent error reported in Power Apps. It will have the following Columns: 
    • Details: table of details about the specific error.
    • Kind: a numeric code used to describe errors.
    • Message: this is the end-user message people see when an error happens "can't divide by 0..."
    • Source: the actual control that the error spawned from.
  • Add these two columns:
    • UserInfo​: I use the email of the user. 
    • Time​: This is the user's current time. 

(2) Add the Office365Outlook connector & setup a button.

Go to Data Sources​ and add the Office365Outlook​ connector.

THE BUTTON:

I setup a button on the home screen of the app.  Which will only appear when the error collection has more than 0 rows.

The end-user has to manually click the button which will trigger the error to send to me, and also clear the table.

You could set this up in an automated way.  Even make it silent.  I find that user's (when they notice an error happened at a weird moment) will contact me when they click the send button.  And give me further details.  This helps me troubleshoot.  And keeps the user engaged in the troubleshooting process.

Insert a button or a label.  And set its Visible property to:  

(3) Set the button to send and clear the data.

Set the OnSelect​ property of your button to:

And here are the results:

Tip:  

Use VS Code to open the JSON and press: crtl + shift + p

Search for "format" in the dialog box that will pop up.  And then click it (download a formatted for JSON if you are prompted).  



Easy error reporting in Power Apps | Email a JSON of errors
Andrew Valenzuela July 30, 2025
Share this post
Archive
Sign in to leave a comment