Trigger power automate flow with Business Process Flow Next Stage button

1k Views Asked by At

I have a model driven app with business process flow (BPF) activated. For each stage of BPF, there is a Next Stage button at the bottom. I want to use the Next Stage button as a trigger to run a power automate flow in which after the Next Stage button of that particular stage is clicked, an email will be sent out. Can this be done by using JS? If yes, can anyone please share with me the JS code? Thanks.

Sample Image

2

There are 2 best solutions below

0
On

Design

A table / entity is created for each Business Process Flow you create. Also, a record is created in a Business Process Flow table / entity every time a BPF instance is created.

Therefore, it is quite easy to add logic when a record changes in a Business process flow table.

What do to

  • Create a Power Automate that triggers when a record is modified in the table associated to your Business Process Flow (it is named after the BPF name).
  • Use the activestageid to figure the current stage (you'll have to query the stage from the processstage table)
  • Implement any logic you want in your Flow (send the email in your case).
  • If your logic is based on values from the main record you can easily retrieve that record's id from the business process flow record
2
On

Create a Power Automate flow with trigger of type when an HTTP request is received.

The generated URL is where your JavaScript can send a request to.

You can also use the when a record is modified, this automatically detects changes like adding to an empty field, therefor you know what stage was filled in.

Many options, many ways to implement this.