cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
legion1202
Helper I
Helper I

Capture error on Form submission

Hey PowerApp Devs,

 

I have a simple form that my techs use to submit End of Days. Everything  works as it should but sometimes Techs say they get a email that a form submission failed. This is because I am using the on success and on failure to notify and email the user depending on the out come...

 

However I would like to capture any errors or codes when a failure happens on form submission. Can I capture that in a email and send it to myself or the tech?

 

This is what I am using on failure

 

Notify(AdminForm.Error, NotificationType.Error);

//sends email to current user logged in
Office365Outlook.SendEmailV2(varCurrentUser.Mail, "Your EOD Submission Failed"," Please contact a Admin for support");

 

 

//sends email to me when a failure happens
Office365Outlook.SendEmailV2("My Email Address"
, varCurrentUser.DisplayName & "Submission Failed", varCurrentUser.DisplayName & "EOD Submission Failed" & NotificationType.Success & NotificationType.Information)

 

Thanks,

GA

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@legion1202 

You might want to consider sending the error in the email formula on the OnFailure:

Office365Outlook.SendEmailV2("My Email Address"
, varCurrentUser.DisplayName & " Submission Failed", varCurrentUser.DisplayName & " EOD Submission Failed - " & AdminForm.Error)

 

I hope this is helpful for you. 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

2 REPLIES 2
RandyHayes
Super User
Super User

@legion1202 

You might want to consider sending the error in the email formula on the OnFailure:

Office365Outlook.SendEmailV2("My Email Address"
, varCurrentUser.DisplayName & " Submission Failed", varCurrentUser.DisplayName & " EOD Submission Failed - " & AdminForm.Error)

 

I hope this is helpful for you. 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

This might be what I am looking for!

 

Thanks!

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (4,475)