Wouldn’t it be great if you could call flows from a model driven app? Well you can , but it is not without its difficulties.

Some background

It is easy to start flows from a Canvas app and actually Model driven apps aren’t much harder.

In my case I wanted to create a quote for an opportunity and the document generation told available just weren’t good enough. I wanted my quotes to look better. There are plenty of other processes that I could imagine I would want to start a flow from a model driven app for. But this is quite a nice example flow.

This Send quote flow will send me an email with all of the quote details coming from my opportunity, related account and order lines.

Quite quickly I created a flow that started with the When a record is selected.

Call flows from a model driven app Microsoft Office 365 image 6

Start flows from a model driven app

And then the Send quote options appeared right there with my opportunity in my model driven app.

Call flows from a model driven app

I managed to run the flows and I got this great success message.

Call flows from a model driven app Microsoft Office 365 image 7

Then I started to make some changes to my flow and suddenly things went wrong.

Call flows from a model driven app Microsoft Office 365 somethign went wrong. Please refresh the page or try agains after some time.

And as a scrolled down that message and clicked on the show more details message there is a message that related to the trigger being incorrect.

Call flows from a model driven app Microsoft Office 365 The input body for trigger manual

Time:
Server/Client Correlation ID: 2733bc97-c17b-4751-9b18-e07da64b140e
x-ms-client-request-id (Client->Backend Request Header): 1947f358-8355-453c-a8f4-d730-e74bb6f8
Error: The input body for trigger ‘manual’ of type ‘Request’ did not match its schema definition. Error details: ‘Required properties are missing from object: value.’.

Whatever that is all about, it is not nice!

So I deleted the trigger and then re-added the trigger and fixed all the references to properties that came from my trigger and I managed to start my flow from my Model driven app once again.

Sometimes I can edit the flow 10 times without any problems and sometimes I have to re-update the trigger after every update. This seems to be a bit of an annoying bug. If you happen to find the same issue and you have a better workaround then please leave a comment below.

Model Driven Business Process Flows

In addition to the above method you can also create a flow that runs from the business process flow. All you need to do is add a flow step to your Business Process Flow and you can run your flow from there.

Call flows from a model driven app Microsoft Office 365 image 29

But the details on how to do flows from a model driven app in a Process Flow will be another post for another day.

Avatar for Pieter Veenstra

By Pieter Veenstra

Business Applications Microsoft MVP working as the Head of Power Platform at Vantage 365. You can contact me using contact@sharepains.com

14 thoughts on “Call flows from a model driven app”
  1. Hi Pieter,

    At first I also thought this is a bug, but I have found out that whenever I reference a form field in my flow, the shceme of the trigger action changes this field to “required” (you can verify it by “peeking code” in the trigger action), even if this field is not required in the CDS entity. And if I don’t supply a value for this field in runtime, I get this error.

    The solution I have found is not to reference the fields from the triggerbody action in my flow, but instead, add a “get item” action as the first action in the flow (right after the trigger), and get the item with the same ID as the triggered item. Then, I reference whatever fields I need from the “get item” action, yet the trigger action scheme do not mark any field as required, and the error disappears.

  2. Hi Pieter,

    At first I also thought this is a bug, but I have found out that whenever I reference a form field in my flow, the shceme of the trigger action changes this field to “required” (you can verify it by “peeking code” in the trigger action), even if this field is not required in the CDS entity. And if I don’t supply a value for this field in runtime, I get this error.

    The solution I have found is not to reference the fields from the triggerbody action in my flow, but instead, add a “get item” action as the first action in the flow (right after the trigger), and get the item with the same ID as the triggered item. Then, I reference whatever fields I need from the “get item” action, yet the trigger action scheme do not mark any field as required, and the error disappears.

  3. Hi, i also experienced that, it is quite fragile. Also when you deploy a solution including such flow, to an other environment, it will break… I had to redo the flow as a solution

    An other question : we have per user app plan licence, and flow isn’t apparently included, we needed to buy separated flow or M365 licence. Did you experience that ?

    Thank you?

  4. Hi Pieter,
    I am currently using a developmental environment and am waiting for licences to be purchased before I can test out additional users with different access privileges etc.
    When creating a flow in an entity for selected records like this under the flow tab, will this appear for all users? We are only purchasing per app licences for our users – are these flows considered part of the same business solution and so are included in our app licensing? And do created flows appear for ALL users or just the user that created the flow?

    Thanks in advance!

    1. Hi Lewis,
      The easiest way to sort this is by permissions. In your roles you can specify if people can run flows or not. So you could just not allow unlicensed users to run flows from Dynamics model driven apps.

  5. Dear Pieter,
    Thanks for your very interesting blog posts!
    the Dataverse trigger (when a record is selected) you use here, got deprecated. how do you work around this with the new Dataverse trigger (create, update, delete)? Can’t get my head around it… thanks for your help!

  6. Hi! I have model driven app and I have created the flow, but my app doesn’t see it. Is it must be configured to allow app use that flow? In canvas app it need to be added to the app by “+ add flow” in edit preview, but I don’t have that button in my model driven app.

  7. Hi Pieter did you ever do this blog post – But the details on how to do flows from a model driven app in a Process Flow will be another post for another day. ? Regards Nigel

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from SharePains by Microsoft MVP Pieter Veenstra

Subscribe now to keep reading and get access to the full archive.

Continue reading