Update field value on change of Stage in Business Process Flow using Power Automate.

In this blog, we will learn how to update D365 record fields on change of stage in business process flow using Power Automate.

Every business process flow with in the dynamics 365 CRM instance has an entity related to it. So whenever you create a BPF, an underlying table gets created. On adding the Business Rule to your solution, this table gets added automatically.

Problem Scenario: Sometimes, you might want to update the option set value based on the stage change of the business process flow. For example, you might want to change the status of an opportunity from open to won when the stage changes from propose to close. This can help you keep track of your progress and ensure data consistency.

Solution:  Here we are updating the option set value on change of stage in business process flow using Power Automate.

We have created a business process flow with the name of “Exam status” on “Exam” entity.

PS: We can do this with Business Rules too which will be in sync but i am showing you all how to trigger power automates based on Stage change of a BPF in case we ever encounter such a scenario.Here are the steps to follow:

Step 1: Create a flow with the trigger “When a row is added or modified” as below:

Notice here that I have triggered this flow on the Exam Status backend table on modification of the column “activestageid”
You can bring this table to the App navigation or use Advanced Find to check its columns. The Exam is the lookup to the exam table where we change stages in the BPF & the Active Stage is the current stage it is in.

Please note it is a lookup too which if you click will say “This is a system entity that does not have a main form. Opening a record form for this entity is not supported.”. Thus it is actually pointing to a table whose name is “Process Stages”

Step 2: Get the Associated Exam record by using triggerOutputs()?[‘body/_bpf_cr164_examid_value’].

Step 3: Initially we saw that the current Stage is a lookup in the Exam Status table pointing to Process Stages table. Retrieve this record using triggerOutputs()?[‘body/_activestageid_value’] .

Step 4: Get Stage Name from the above stage record by using Compose outputs(‘Get_Stage_Record’)?[‘body/stagename’]


Step 5: Finally use Switch statement on the output of compose and update the status accordingly for all use cases.

That’s it! You have successfully created a flow that updates the option set value of Status on change of stage in business process flow using Power Automate.

and the Status is updated:

Hope it helps!

One food for thought for you: Here we have used switch cases for all the Option Set values we have as status. So if a new status is introduced, we have to add another branch use case. Can we avoid that, THINK THINK!? See you in the next Blog.

In another newz, this is my 50th Blog and I am so happy to share with you all whatever I have learnt and I am learning in my Power Platform journey. Hoping to stay connected always!

& the Power Quote of the Day is:

“Believe in yourself and everything you are.”
― Shalinee Goel

Author: powershalinee

Techno-Functional Consultant

One thought on “Update field value on change of Stage in Business Process Flow using Power Automate.”

Leave a comment