When using Microsoft Flow the out-of-the-box button is nested under the ‘Flow’ section and is not easy to find nor is it customizable. Triggering the flow using a ‘Flow Button’ makes the button appear under the ‘Run Flow’ branch which is a nested button that is unintuitive for users.
It is much nicer to have your own customized button to trigger a flow and to do this is surprisingly easy.
I created my button using the Ribbon Workbench which calls a command. We’ll go into detail what this command does later on. Here’s my button.
Below is the flow I want to call from the button in Dynamics 365. As you can see there’s a trigger that says ‘When a HTTP request is received’. Once saved the URL will generate for this endpoint and you can define a JSON object that will be received by the Flow. In this example I’m passing through a ‘path’ to the ‘Create File’ method. We’ll keep this blog on the topic of calling Flows from a Dynamics 365 but there’s plenty of information out there on how passing parameters to Flow works. The Flow is simply going to create a File under the path and then send a response with an object.
Above is the code I used to call my Microsoft Flow. The code passes through a ‘pathObj’ which is the object that the request endpoint created in Flow is expecting. The Flow will now create a File under the ‘/Account/’ path.
There you have it, using the out of the box way of calling Microsoft Flow’s from the ‘Flow Button’ should not be defaulted to because calling it from your own custom button is surprisingly easy.