When building a PowerApps, you will most likely be submitting a form of some type, or doing some other execution that could potentially error. You may want to capture this error somewhere, or even show it to the user.

Here is how you can show the error message to the user. In this example, we’ll show the error when we try to submit a simple SharePoint list item update.

Select the form. In my example, my form control is named frmEmailAttachments.

  • Select the form. In my example, my form control is named frmEmailAttachments.
  • Find the OnFailure event. This will automatically trigger only if an error occurs when you submit your form.
  • Change the formula to “Notify(frmEmailAttachments.Error, NotificationType.Error)”.
  • This will add a notification message to the top of the page when the form is submitted and if there is an error.
  • Now, when an error occurs when submitting your form, it will appear to the user.

Find the OnFailure event. This will automatically trigger only if an error occurs when you submit your form.

Change the formula to “Notify(frmEmailAttachments.Error, NotificationType.Error)”. This will add a notification message to the top of the page when the form is submitted and if there is an error.

Now, when an error occurs when submitting your form, it will appear to the user.

Of course, you may not want the error to be shown to the user. You may want to save the error, notify the admin, or something else. In this case, you can show a friendly message to the user when an error occurs. Notify(“Houston, we have a problem!”, NotificationType.Error)


You can capture the error, in this case frmEmailAttachments.Error and do what ever you want with it without the user seeing the details of the error.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.