Using changesets in Power Automate Flows for atomic transactions

Hello Guys,

In our previous blog we have seen how to create and use custom dialog boxes using HTML web resource. Today we will see how to use changesets in PA flow for atomic transactions.



Do follow us to know more about Dynamics and Power Platform. 
Also if you like our blog then please comment and share this blog with your friends.

First of all we will understand what is atomic transactions. Basically Atomic transactions are the transaction where each transaction depends on each other. It means if we have two transactions and if one of them gets failed, then other also gets failed. As we do Create, Update and Delete in D365 CRM, we need to ensure these transactions are atomic.

If we talk about synchronous workflows then, if it gets failed then all transactions are rollbacked. In the same way we want some mechanism in MS Flow where we can achieve the similar feature. 

We can use changesets in MS Flow to make transactions atomic. Let's see how to use it with an example:

We have Deal Table as shown bellow:




Now we want to create one MS Flow which will be triggered, when we change the Deal status to approved. It will create one activity record and will update Deal approved Date in the background.

Go to https://make.powerautomate.com/ and select your environment and solution. 




Add new cloud flow -> automated and create it as shown below:




Now configure the first step as shown below:




Now add new step and search for changeset.




Inside the changeset add two more steps as shown below:




Here first step will create Activity record and second step will update the Deal Table. 

So our flow is ready. Now we will change the deal status to Approved and will see.





So here you can see our flow run successfully. Now we will make the PA flow failed and will see what happens.




Here we have used unknown guid for deal to make the update step failed. Save the flow and again change the status.




As you can see update step got failed and due to that create also did not work as it depended on update step though it was first step.

Hope it helps...


Comments

Popular posts from this blog

Read Only Sub Grid & Editable Sub grid in Dynamics 365

Understanding Sales Process in D365.

Understanding Business Unit in Dynamics 365.