Blog
Use Power Automate to add a Business Process Flow stage name to a Table
Business process flows are a great way to ensure the correct data is collected for a customer’s journey. Historically, each record could only have a single business process flow (BPF), which made it easy to track and set the stage for many records at once. Now, customers can have multiple BPFs going at once. Which allows records to be on multiple customer journeys at once. This is a great piece of flexibility but does add complexity to the reporting and management of these stages. Let’s take a look at how we work with these BPFs to improve reporting, management, and functionality.
Where is the BPF stage stored?
When a business process flow is created a new table is also created in the background. This is the table that stores the current stage of the BPF and all information related to it. Now since a table can have multiple BPFs tied to them they automatically have a one-to-many relationship between the base table and the BPF table. As you might already expect, this means we can’t add a column to the base table showing the stage of the process. This can be an annoying reporting issue when you want to see which stage of the process cases and opportunities are on from a single list view. Fortunately, and unsurprisingly, a solution to this can be found with Power Automate.
Creating the Flow
Before we get started on the flow, we will need to add a column on the base table. We will use the case table for this example. When making this column there are two options. One is to have it be a choice column with options that replace all the possible stages. This is convenient when filtering lists because the exact name of each stage will appear. The other option is to make it a text column. This method is great because you never have to go back and update choice options whenever a BPF stage is added or changed.
Now we can start building the flow. The trigger will be whenever the BPF stage table is added or modified. The name of this table should be the name of the BPF. The first step of this flow will grab the BPF stage record. We need to do this so we can get the formatted value of the stage name.
Next, we will set the value of the new stage column we created. The trick here is to set the value to the formatted value of the activestageid table. One way to get the specific name is to run the flow and look at the outputs of the Get Stage step. The formula should look something like this:
body(‘Get_Stage’)?[‘_activestageid_value@OData.Community.Display.V1.FormattedValue’]
That’s it! Now users can add that new stage column to any views or reports and see the stage of the record. Just note that a new flow will need to be created for each Business Process Flow.
Contact Beringer Today!
We love to implement Microsoft Dynamics 365 and Power Platform solutions here at Beringer. We’ve been working with Microsoft Dynamics since its inception, and we’re always finding innovative ways to implement the latest tools and help automate business processes.
Beringer Technology Group, a Microsoft Solutions Partner for Business Applications, specializing in Microsoft Dynamics 365 and CRM for Distribution also provides expert Managed IT Services, Backup and Disaster Recovery, Cloud Based Computing, Email Security Implementation and Training, Unified Communication Solutions, and Cybersecurity Risk Assessment.