How to Call a Flow on the Click of a Button in Model-Driven Apps Using Power FX

Introduction

To directly call a Power Automate flow on the click of a button in a model-driven app, this blog will walk you through how to call flow on button click in model-driven app using Power FX.

High level resolution steps

For this functionality, we make use of the Ribbon Workbench, and a trigger action called “When a HTTP request is received” in Power Automate, and copy the URL to the Ribbon Workbench.

Detailed resolution steps

Step 1: Add a trigger action called “When a HTTP request is received” in Power Automate and save the flow to generate the URL automatically, and then copy the URL as shown below.

Call Flow on Button Click in Model-Driven App

Step 3: Open the ribbon workbench and select the solution and entity where you want to add the button, and drag & drop the smart button named “Run Webhook” to add a new button into the grid or form as shown below:

Step 4: Click the button to view the properties and paste the URL copied from the Power Automate flow into the Webhook URL box under Properties on the right pane.

Output

Now the button is available in the Form, and on click of it, the flow gets triggered. This confirms the successful setup of the Call Flow on Button Click in Model-Driven App using Power FX.