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 / Multi form error handling
Power Apps
Answered

Multi form error handling

(0) ShareShare
ReportReport
Posted on by 5

My app has a screen for users to verify that the displayed data is theirs. This screen contains two forms, each storing related data to a different SharePoint library (Form1 -> library 1, Form2 -> library 2) and controlled by one submit button. The data in these forms doesn’t need to be validated for user input errors, as it is all retrieved from another SharePoint library; thus, already correct.

 

However, once the submit button is pressed, it is crucial that both forms will be submitted or none at all, as the data is related. If an error occurs in the system or for whatever reason possible, e.g. internet dropped, both forms should be refrained from submitting.


As for now, in the OnSuccess property, I navigate the user to a “Successfull” page, but this would always navigate the user to the page.


Is there a way to:

   If Form1=successfull and Form2=successfull

       Action: submission successfull -> navigate to page

 

   If Form=failed and Form2=successfull

       Action: stop submitting Form2, notify error

 

   If Form=successfull and Form2=failed

       Action: remove Form1 submitted data from SharePoint library 1, notify error

 

Many thanks in advance! I’m new to this so all the help is appreciated.

 

 

Categories:
I have the same question (0)
  • Verified answer
    Michael E. Gernaey Profile Picture
    53,504 Super User 2025 Season 2 on at

    Hello,

     

    Let's say you have these two Forms to Submit, Form1 and Form2. Now unfortunately you cannot get exactly what you want out of it because Form1 could work and Form2 could fail and you would still have Form1 data written to the back end (unless you roll it back).

     

    But to sort of give you what you want:

    • In your submit button ONLY submit Form1.
    • Then in the Form1.OnSuccess, have it trigger your Form2 Submit.
    • If Form1.OnFailure happens instead don't trigger Form2 and show your error

    Now when Form2 comes back if OnSuccess happens you know both worked and you can navigate to success.

    But if OnFailure happens you know that your data is in a partial state since Form1 did submit successfully and you will need to figure out how to resolve that, but at least you can show the error as you want.

     

    The only way to get around this would be to create a custom API plugin and call that (instead of SubmitForm) from your app and then it could do the work in a transaction and rollback.

    Cheers
    If you like my answer, please Mark it as Resolved, and give it a thumbs up, so it can help others
    Thank You
    Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey

     

  • Mike-80 Profile Picture
    5 on at

    Hi Michael,

     

    Thanks for your reply.
    I kinda knew this issue would give me headaches 😊. Just curious why Power apps doesn’t have any out-of-the-box functionalities to keep data consistent when dealing with issues like this.

     

    Creating a custom API might be a solution worth looking into, but a previously mentioned, I’m new to all this so I will have some homework to do 👍.



     

     

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 740 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 342 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard