So, one of the pretty cool features in Dynamics 365 and model driven apps is the ability to configure business process flows without having to build any custom UI, and instead just slot building blocks together to produce a set of steps for users to follow!
In this blog post, I’ll show you how to get started with these process flows, and by the end of this post, you’ll have build your first!
Solution and creating the object
To start with, I’m going to add my model driven app and table into a solution together to package my customisations.
Next I’ll select to create a new business process flow in my solution, then I’ll give it a name and select the table I’m creating it against.
I’m going to call my business process flow account onboarding, and set the table to account.
Next I’ll select create which will take me to the creation page for building business process flows.
Building blocks
Okay, so now let’s take a look at the components we have to build things with. With regards to the wider business process flow, the major building blocks we have to work with are stages and conditions.
Stages are the different points in the business process flow we can be in, each which will have one or more steps or actions within them when selected.
Then we have conditions for determining the stage to appear in the business process flow based on something else that has previously happened.
Actions within a stage
Okay so now lets look at the actual things we can do at a stage of a business process flow. We’ve got 4 different ‘actions’ as such that we can add to a stage.
First we have the very simple data step allowing us to add a field to a stage of our business process flow, for users to update.
Next we have the ability to add classic workflows to a business process flow stage so that users can trigger these.
Following that, we have the ability to use classic actions from Dynamics 365 which users can trigger at the stage of a business process flow.
And finally, we have the ability to trigger Power Automate flows from a business process flow stage, which is one I might more commonly use than an action or classic workflow.
Building out a BPF
Okay, so now lets start looking at building out a Business Process Flow. I’m going to build a really simple business process flow and say that I want to populate two fields in step one, and then another 2 in step 2. Then at step 3, I’ll run a cloud flow!
First I’ll add a data step block to my first stage by dragging this into the stage.
Then I’ll use the properties pane, whilst selected on my data step to give my step a name and select the field I want people to populate at this action within my stage. I’ll then repeat this for my second action.
Make sure that when you make changes to actions and stages, you select apply in the properties pane to save your changes.
Now to add the second stage to my business process flow, I’ll select ‘add’ and then ‘Add Stage’.
Then I’ll need to select the place I want to put my new stage in.
Now that I’ve got my new stage, I’ll very simply follow the same steps as before to build out the actions at this stage of my business process flow.
Now let’s take a look at something a little different. In my third step, I said I wanted to include a step to run a flow. Let’s take a look at how to do this. I’ve added the third stage of my business process flow. Now lets add the flow step action.
Now I’ll simply give this action a display name to appear next to the run flow button in my model driven app. Then I’ll click the search icon in my select a flow input in my properties pane to find flows I can use in my environment. Be sure to include these in your customisations solution to prevent issues of missing dependencies if you attempt to deploy these customisations to any other environments.
I’ve selected my flow ‘Send account alert’ to appear in stage 3 of my business process flow.
Save and activate
Okay! So now that I’ve finished making my changes to my business process flow I’m going to select save to save it, then I’ll select activate so that it can be used in my apps.
Activating your business process flow might take a few minutes so hang tight if the loading bar doesn’t move too quickly.
Once your business process flow is activate the activate button should change to say deactivate.
Add the BPF to an app
Now that we’ve created and activated our business process flow, we need to add it to the app we want to see it and use it in. To make this edit I’m going to open the edit mode of my model driven app or Dynamics 365 application.
Then in the very left hand pane of the app editor, I’m going to select business process flows, and then either I can select the toggle at the bottom to include all of the business process flows available in my app, or I can just add the ones I need if this is turned off.
Next I’ll publish my app and open it in play mode to test things out.
Testing it out and overview
Okay so lets test it out. I’ve opened my app in the play mode. Now for any existing records they won’t have an active process set. So I’ll need to select process and assign an active process.
And there we have it! I’ve now got my business process flow working with different stages and my actions within each!
You can also see I have my flow available to run at stage 3 of my process
That’s as simple as it is to create business process flows to work with model driven apps and Dynamics 365! If there was something in this guide you didn’t quite understand or that you need more help with, let me know in the comments down below!