cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ArturasF
Helper III
Helper III

What is the best way to ensure success on multiple functions?

This is a rare problem but it has occured and the consequences are very bad.

 

1st case:

 

On press of a button a single patch must be executed. You can handle errors in multiple ways. If patch was not successfull (due to connection or other problems) - you can handle it with errors functon, or simply reattempt to patch again.

 

2nd case:

 

On press of a button two patches must be executed. If at least one fails - further actions with application will be impossible - app will misbehave. For instance first patch succeeded, and second did not, or first failed and second succeded.

 

Desireable outcome should be: either all patches succeed either none. 

 

You can create a logic and run second patch only if first patch is successfull. But how to deal with situation where first succeded but second did not.

 

I was thinking on reattempt logic where app retries second patch on fail. But then an infinite loop is created. Loop also can be broken if user closes the app.

 

What is the best way to handle these type of situations?

PS: I have many cases where multiple commands must execute in a sequence (not only patch)

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @ArturasF ,

A conundrum for sure - the scenario requires reversing the first Patch if the second one fails. The only way to do this would be to store the "old" values in a Variable (you could do this in a record Variable) and then Patch it back if the second one fails.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

1 REPLY 1
WarrenBelz
Super User
Super User

Hi @ArturasF ,

A conundrum for sure - the scenario requires reversing the first Patch if the second one fails. The only way to do this would be to store the "old" values in a Variable (you could do this in a record Variable) and then Patch it back if the second one fails.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Users online (1,541)