In this blogs we will see how a Power Automate Flow can be triggered on change of a BPF (Business Process Flow Stage) with in Dynamics 365 CRM.
So Let’s begin..
Every business process flow with in the dynamics 365 CRM instance has an entity related to it see the below example of the Opportunity Sales Process Flow.
In the below solution I have added the Sales Process BPF (Which is the Opportunity Sales Process BPF ) and the entity related to this BFP gets automatically added into the solution.
If we do an advance find over this BFP entity, you will see that for every Opportunity entity record an Opportunity Sales Process entity record is created which holds the data shown in the below image.
- Opportunity Field – Denotes the Lookup to the related Opportunity Record.
- Active Stage Field – Denotes Process Stage information which is currently active on the related Opportunity.
Now whenever a stage changes on an Opportunity the Opportunity Sales Process entity record related to the Opportunity changes. See below example.
Opportunity is on Develop Stage —> The active stage field on the Opportunity Sales Process entity will show Develop.
Now that the Opportunity is moved to Propose stage the Active Stage shows Propose.
Power Automate Flow.
Trigger
Now for our Power Automate flow will be when the Opportunity Sales Process entity is updated (Business process flow entity).
To get the stage name you need to retrieve the Process Stage as it is a lookup in the BPF entity.
Output:
When you change your BPF stage the Active Stage in the BPF will be updated the flow will be triggered.
Hope this helps 😊!