web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Displaying Error Code ...
Power Apps
Answered

Displaying Error Code and Success Code

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi

In the application I'm working on, at the final step, the application updates a SharePoint List with captured input.

I want to know how can I display returned error messages in case the update fails.

 

Also, I want to know how I configure the application so that if the update is successful, then it will move to another page (or back to main page).

 

 

Categories:
  • v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi@yjamous,

    Based on the issue that you mentioned, do you want to display an error message when the updates fail and navigate to another screen when the updates succeed?

    Could you please share a bit more about the scenario, is there a form to submit or some single controls to patch?

    I assume that you have a form and I think the Notify() function could achieve your needs.

    I have a test on my side, please take a try as below.

    Set the OnFailure property of the Form as below:

     

    Notify("The updates fail, please check it and try again!",NotificationType.Error)

     

    Set the OnSuccess property of the Form as below:

     

    Navigate(BrowseScreen1)

     

    Note: In my test, I use SubmitForm() function to update.

    If you use Patch() to update, please provide more details.

    Best Regards,

    Qi

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Can this property be set on the Screen level? I don't have a form in the screen.

  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi@yjamous

    Do you mean that you update the SP list without a form?

    Of course, you could put Notify() function with the Patch() together. You could use the Errors() function to check if there is an error occurring.

    You could check the Errors() function here.

    I have a test on my side, please take a try as below.

    Set the OnSelect property of the Patch Button as below:

     

    Patch(
     'FPC-Purchase Orders',
     Defaults('FPC-Purchase Orders'),
     {
     Title: DataCardValue9.Text,
     School: ComboBox1.Selected.Result
     }
    ); // Put your Patch formyla here.
    If(
     IsEmpty(Errors('FPC-Purchase Orders')),
     Notify(
     "Success!",
     NotificationType.Success
     ),
     Notify(
     First(Errors('FPC-Purchase Orders')).Message,
     NotificationType.Error
     )
    )

     

    In addition, if you want to check if the currently patched record succeeds, you could use a variable.

    Set the OnSelect property of the Patch Button as below:

     

    Set(
     PatchedRecord,
     Patch(
     'FPC-Purchase Orders',
     Defaults('FPC-Purchase Orders'),
     {
     Title: DataCardValue9.Text,
     School: ComboBox1.Selected.Result
     }
     )
    );// Put your Patch formyla here.
    If(
     IsBlank(PatchedRecord),
     Notify(
     "Success!",
     NotificationType.Success
     ),
     Notify(
     "Fail!",
     NotificationType.Error
     )
    )

     

    Best Regards,

    Qi

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 432 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 347

#3
WarrenBelz Profile Picture

WarrenBelz 254 Most Valuable Professional

Last 30 days Overall leaderboard