Reputation: 314
In SQL there is this thing called "transactions" that basically allows one to run 3 things in succession and if the 2nd fails none of them is executed. Very useful on a financial scenario when you want to add something on one side and remove from another.
I need the same on power automate, say run a SQL stored procedure + Send an email + add a file to SharePoint. how should I go about it? Thus far I've got that a step is not run if the previous fails (unless specified otherwise) but that only works if the error is on the first part. I'm not even sure if you could "unsend" an email if the file then fails to be added to SharePoint.
Note: Although I'd prefer an aproach that isn't dependent on the order, I just so happen to be flexible with it (so the email could go last if the other steps could be reversed when the email fail)
Upvotes: 1
Views: 976
Reputation: 3645
Power Automate Flows now have ChangeSets, which is a transaction. Either all of the steps in it succeed, or they are rolled back.
Changeset info from Microsoft documentation
Upvotes: 1
Reputation: 840
Unfortunately I don't think there is a transaction -> commit/rollback
pattern in power automate🤔
What you may do is reuse the try-> catch -> finally
pattern and just 'manually' undo the done changes in catch
scope and send the mail as last step in try
scope 🤔
link to the pattern sample -> https://github.com/pnp/powerautomate-samples/tree/main/samples/Try-Catch-Finally
Upvotes: 1