简体   繁体   中英

Trigger power automate flow with Business Process Flow Next Stage button

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.

示例图像

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM