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

Notifications

Announcements

Community site session details

Community site session details

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

Displaying Error Code and Success Code

(0) ShareShare
ReportReport
Posted on by

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:
I have the same question (0)
  • v-qiaqi@microsoft.com Profile Picture
    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
    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
    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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard