Automatically update business process flow stages using Microsoft Flow | BRK3158
![Automatically update business process flow stages using Microsoft Flow | BRK3158 Automatically update business process flow stages using Microsoft Flow | BRK3158](/pic/automatically_update_business_process_flow_stages_using_microsoft_flow_brk3158/ZUc4M291Yzh4azg_.jpeg)
Q hi. Everyone thank, you for coming along to, my, session, this afternoon this. Is my second, presentation. For the day I actually have one more after, this at 6:20, p.m. on, at, theater and I my. Name is Eliza Benitez, I am by. Trade and functional consultant. I'm all, the way from, New, Zealand and, Wellington, it, took me three flights to get here I'm still smiling I promise, I'm not jet-lagged. And. I also happen to be a Microsoft, MVP and. Applications. And in, this session today I'm going to show you how. You can automatically, update business, process flows stages. Using flow but, as of this morning we all know that is is going, to be cold power automate, going forward, so. Before we get started I, want to make sure that you're all engaging, today, and throughout this week by, supporting, the presenters, as well as the booths that you're going to be interacting, with at, the. Hub so if you want to do a tweet or a post on LinkedIn by. Taking a photo of my session, I'm, ok with that you can find me on Twitter, and on LinkedIn and please make sure you use the official hashtag of, ms ignite, so. In terms of the agenda today I'm going to go through what, is a business, process forward for those of you who, aren't familiar with it today I'm, gonna, talk about oh. Sorry. We've got music playing still. Thank you. There. You go. Cool. Thank you so, where was I all right so we're gonna I'm going to talk about the use case and then, I'm gonna do a demo of flow with Paris portals, and a modal driven app and then I'm gonna open the floor to questions. So. Put your hands up if you know what a business process flow is. Okay. That's not a bad ratio it's, better than I thought so this, is a screenshot. From. My, first, ever vlog on my youtube, channel if you, do want to find me on youtubes just search for a first name Eliza, last name Benitez, and you'll, come across my YouTube channel where I do a lot of flow dynamics. 365, and Paris portals, and this. Is what business process flow is used to look like so. It, came out with dynamics. Here in 2013. Before it changed, its name to dynamics, 365, and so fast forward to today this. Is what it looks like so, in red you have your, business process flow stages, as you, can see in, my screen shot I have three theirs in progress review, and approved, now, this is a business process flow that I created, against, a, custom. Entity called, application and, over, on the right hand side of the screen you, can see details about, the business process flow you, can see the state that the business process flow stages, in so, for example it's finished and you can see that the approve stage has been completed, and underneath. That where you see external, reviewer. Status, and internal, reviewer status are the, steps that are required to, complete that business process flow stage and that, little tick on the left of the step.
Indicates. That it has been completed. So, when you build your business process, flow in the designer this is what it looks like so, the, blue shaded, areas are your business process flow stages, and like, I mentioned for. Every business process, flows stage there are steps that an end user is required to complete which. Is the shade in green and these, are essentially, fields, that live in your CDEs. So, the whole purpose of a business process flow, is to guide an end user right. From A to B, the very end so that they know what steps they need to complete. Throughout the lifecycle and over, in the right-hand side you can also, configure. It where you can make a step mandatory, so, that means before, they can move from one stage to another they. Need to complete it otherwise it's gonna prompt. Them to do so. So. When, you create a business process flow when, you have a deep dive into the solution, there, are actually going to be two, components, one, is called process, so that is the visualization, of, the business process flow that appears, in the model driven app and the, second one is an, entity, that is dedicated. To that business process flow, and. When. That entity is created, it inherits, the same name, and plural, name of the business process flow, and it's, important, because back. In, 2017. The. Attributes. That were previously cold. To automatically. Move from one, stage to another is, deprecated. So they used to live in the, record. Itself so, if I go back to the example that I talked about earlier the, fields, would used to live in the application. But, now it's in a separate, dedicated. Business. Process, for entity and that's the way we need to be calling. These attributes, in order to do, some automation, so. The main three, attributes. Is process. ID, stage. ID which represents, the idea of the stage and then, we have something called a traversed, path, as well. So. When. We update the. Business process, flow stage, automatically. Using flow, we. Need to do things like retrieve. The. ID of, the active stage that the business process, flow is going to represent to the end user and if. The traverse path needs, to be updated as well the. Traverse, path is essentially. The. Attribute. That, will contain, the IDS, of the stages, based. On the, lifecycle of that particular, record so, you remember how in my, earlier side there were three stages so. If an application, record, has moved from in progress, review. To approved in the, traverse path attribute, you should see three values, that will be separated, by a comma so, this is what it looks like. So. This is just a screenshot from my. Model-driven app and in. The middle, you see that your first path and when you hover over it you, get this big long. String. And essentially, it's those three IDs that represent, the stage IDs. So. The fields that you're also going to reference are. Things like the status, and the status reason these. Are fields that represent, this stage, sorry. The state of the stage so whether it's been completed, or not completed. And then, we also need a reference, the record, that that BPF. Is associated. To in other, words the application. So. In terms of the state of the BPF, it's. Important, because it. Again, reflects. Whether, that stage has, been completed, or not so. It's important, when you want to do some automation, behind. It that you do, update, the states to correctly, reflect, what. State it is in to, the end user, so. If you're still confused don't, worry I will go through this in detail, so. In terms of the use case you're, in for a treat because, not. Only are you gonna see flow in action, you're, gonna see a Paris. Portal, and so, the Paris portal, represents. The, grant application. Management solution, where. You have an applicant, that will submit an application and. Then, you also have the external reviewer, who's going to log in and review, that application. We, also then have a model driven app where, this, is where the internal reviewer, would ideally, review, the application. And then, you're gonna see Universal, resource scheduling, has, anyone seen universal. Reads we're scheduling before. All. Right. Thia it's really cool it's, one of my favorite things about Dynamics 365, and then, yeah I'll talk about the flow, so. In terms of the business. Use case. Like, I mentioned it's gonna, reflect. This, so, when. The applicant, submits, the application, the, business process flows stage will then automatically, update, to review, once.
The External, reviewer has been allocated, using, Universal resource scheduling, we, will then have the external reviewer. Review, it and approve it through the Paris portal, and then, we're gonna have the internal reviewer, review. It and approve it and once, there are two approvals, that's. When we, want the business process, flow stage to, automatically, update from, review to approve so. It's a whole end-to-end process. And you guys are gonna see it in action. So. Time. For a demo now. Before I do the demo I'm. Gonna do a sacrifice, because I need, my demo power today and I need to hope that everything runs smoothly you guys with me, cool. All. Right. So. I'm gonna switch over to my, laptop, so. This is my float I've. Just zoomed in so that people that back can see it more clearly so. My trigger for the float is when the application. Status, reason, is updated. So, I'm going to quickly switch over, to my model driven app to show you what I mean. So. This is my, application. Record in my model driven app and we. Have a field over here called, status, reason and so. When, the, status is in draft it will, be in progress, and when. The applicant. Has submitted it it's going to update to review, and once, we have two approvals, it's going, to update from review, to approved, so, that's my trigger, the, application, status reason, which. Is also defined in what, we call an attribute, field or item for the trigger so. This trigger is when a CD s record, is updated. The. Next action that we have in my flow is now. We are retrieving the. Application. Pfft, record, so, this is the one where I talked about where, an entity, is created, that is dedicated. To the. Business. Process flow that we've created and, that, will represent the. Attributes, that is reflected, to that business, process flow in the model driven app so. This action that I'm using is, what we call a CD. Escalus Records, action, and you'll. Notice that there, is a filtered, query in here, and, I'll. Explain why. We, use a filter query. So. As I mentioned when. When. We want, to cool the attributes, from the business. Process, for entity, record. Because. It's an entity record, there are going to be multiple records, that are displayed, which is what you're seeing right now so. We only want to update that, BPF. Entity record, that, is associated to the application. That triggered that flow right, so. That is why we use a CD s list. Records action, and so this query, in here is basically. Saying only retrieve, the. BPF, entity, record, that, is associated to, the application. That triggered, the flow, so. Once we've done that, action, the, next step that we're going to do is use, a parse JSON and within. That, parse JSON action, we. Are using an expression. That contains. The first function. And I'm, going to explain why we use. This expression, if, I, were to use the, parse JSON just. As is. And. I. Reference. One. Of the fields, from the CD s this records action, so, for example active stage an apply. To each, look, here and it will cocoon. That parse. JSON action, and that, is because would the CD s this records action, it's, designed, to return multiple. Records and, when, there are multiple records, returned it's going, to be in the form of an array and so, flow is smart enough to recognize.
It's, Gonna return. More. Than one record and so that apply to each their peers so, to avoid that this. Is why we use an expression, that will. Use the first function, so that it will only ever retrieve, that one record that is returned in that CD s list records action, and the, parse JSON is, a. Way of being able to select, the field values returned, from. That CD s list, records action, later down, in the flow for. Advanced, users in the room you, can get, away with using a compose. Action. With, an expression. But. For the purpose of today I'm going to show you the, parse JSON, technique. So. After we've done that there. Is another. Action, and it's. A CD s list records action, and this. Time what, we're doing is we, are retrieving, the, stage IDs, for. Review. And approved. The. Reason why we are using the seediest list records action, again is because. If, you. Did some research into, business, process, flows on, the, dock stop microsoft comm website, it, actually tells you how. You can retrieve, the stage IDs, when. You want to programmatically. Update, from one stage to another so. On the docks up Microsoft comm site down. Below in the screen you'll, see an API request, and, basically, it's, calling, this, entity called process, stages, and when, it calls that process, stage entity what. You also need to do is ensure, that you, provide. The. Users, process for instance, ID of that, application. BPF. Entity, so. To get this ID. It's. Quite straightforward, you, just need to go to your, business process, flow designer and it's, an ID up here and. Once, you copy and paste that API request, into your browser you'll. Have your ID at the end and you need to call, your, CD. Incidents, so, this is what it looks like when, you dump it into something like notepad plus, plus and you, enable the JSON viewer, it's, now a bit more user, friendly for us to understand, and in, here you'll, see the process stage ID of approved, and, review. So, this is represented, by those, two. CDs. List records action, so, this, is saying give, me the, process stage that. Is related to this. Record up here where, the stage name equals, review and vice. Versa if we're approved, we. Are also then using, the same technique. Of parse, JSON, where. We use the first function, and in an expression to avoid apply, to each appearing, and you'll. Notice that I've got these, several. Actions side by side so, this is what we call a parallel. Branching. Technique, where. You can have actions running. In parallel when, they're not dependent, on each other, they, can run at the same time.
So. Then we come to the final part of, the flow and, this. Is an action, called. A switch and a. Switch is useful, when, you want to perform a. I. Suppose, like a check, so we're not using the condition, builder in this scenario because a switch, is perfect, when you're only looking, at one field, so. In this case I, have. A. Initialized. Variable, action, where. I want the, switch, to. Happen based on the, status reason, so, if the status reason, equals, in review. Then, I, want it to switch. Over to one case otherwise. If, the, status reason, equals approved I'm, going to switch, it to a different case so. When we expand, this, final, action, this. Is what it looks like. So. The, binary, numbers, that you seeing in here is the value of the. Status reason field so. This is. And this is approved, and so. The final step that we're doing is we're updating the, business process, flow record, so, again when, I say the business process flow record, I'm, referring, to that dedicated, entity. That. Represents. The. Business process flow associated. To, that application, and so. By, using the, parse JSON from earlier, so if I just scroll down this. Is how we can, reference the, business process, flow instance ID and that's. From this, action. Up here and we parsed it so. As you can see by parsing, it it allows you, as a user to, select, the, values returned from that CDSs, records action, and then. The same technique, we're applying here, we're, saying grab, the review, stage, ID, from. The parse JSON response. In here and. We're. Also only. Updating. The, application. Based, on the, application, that triggered the flow and, for. The other, one, which. Is here, on the right we. Are applying, the same technique. But. The, key difference here is that we're updating two, fields, one is, the status reason and the one is the status because, as I mentioned earlier you also need to make sure that the state of the BPF, has, been updated, so that is it is correctly, reflected. Back to the end-user. Okay. So. That is a flow walkthrough, and now. I'm going to do the, end-to-end demo, from. The parent portal and, show. You universal. Resource scheduling, as well.
Okay. So. Here's my portal, I've. Just got one application, up there that I tested earlier so. I'm logged, in as k9. So. K9, as an applicant, and she, wants to submit for grant, because, her, and her team have created a smart caller for her dog that. Is associated, to an app so. The, app will notify you when your dog wants to use the bathroom, because. It detects the temperature, levels of the dog and so, that's the type of grant that she wants to apply for us so that she can get funding and go, global with her app does. That sound like a cool idea I. Don't. Have a dog but I wish, I do okay. So this. Is what, we call a web, form and perhaps portals, and a, web form contains, web form steps so, what you seeing right now are fields. That are within, a web form step and all, the information, that you see in here today in terms of the fields, I actually, grabbed this from an actual, grant application. Form, online from. A government, agency website. And. So the. Idea is that you. Can see how, you. Can create an application online. Using. Parents. Portals, and, this. Is all configurable, this. Didn't. Require any code. I'm not a developer. So I've done all of this simply. Through some configuration. So. I'm just filling in information, now about the, business itself and the. Other cool thing that you can do with parents portals, is that it's got native, SharePoint, integration that. You can set, up yourself and, to. Demonstrate, you, can add a file so, I'm going to add a test, word. Document, and. So as soon as I upload this through. This, Web form step it will, actually create. A document, location, in SharePoint, which, you can also see from the. Record. Of the, application, and the model-driven app. So. Then the final web. Form step is something. General, for the, applicant. To apply. Okay. So. Now, that I've created that application, it's going to be in a status reason of draft so. I'm going to head back to my moto driven app I'm going to head over to applications. And we'll. See that that's the application and. So six five six. Five that's, it, so. When we open up the application. Initially. We'll see that it's in progress and the status reason is draft so. The next step that I'm going to perform is I'm, going to submit the application. And. By submitting the application I, have, another phone in the background, that's going to be triggered that, will go and update the status reason, to approved, I'm, sorry to submitted, so. When i refresh, my browser we'll see it submitted and when. We head over to the model driven app and we hit the refresh button we. Should see that updated. To submitted, and, because, we were updating the status reason, that's, now going to update my flow so, my flow will then be triggered, and it, should now move it from in progress, to review so. Moment, of truth demo, powers let's do this. So. As you can see it's moved, from in progress, to review, and we, can see that the status reason is submitted. Alright. So that's the first half. Sorry. That's the first part of the the. End-to-end process. So. What I'm gonna show you now is, an inside view into, Universal. Resource scheduling, so, I'm going to go over to, my schedule board and this, will pull up a list of resources that are available, who. Can be the external reviewer for the application. So. We should see some, names up here and as. You can see there's a, total. Of 13 so. This is the application that. K9. Just submitted so, when I click on find availability. What, we're gonna see is that, this list will reduce, down from. 13, to I think. 600k, 4 and that's, done by some, smart, filtering, because, it, knows that I've, created, an, application. Where. Someone, is required. For an animal expert. Ok. So, then the next step that happens is. The. Admin. For the grant application, management. Organization. Can go ahead and, book, a resource. And can. You just excuse. Me one moment because I forgot to do something as part, of my, test earlier, so.
Just Bear with me. I'm. Just trying to get that resource to hear again so I can, continue. With booking. Okay. So I was hoping that, Cesar, Millan or Rebecca. Garnet, would appear. So. That. Didn't. Work okay so. I'll try with Holden, Caufield. So. It's worked out that I. Can, book these resources, because they, have a characteristic, of animal. Expert, and so. Ideally. What happens is they, click on book and exit and. Once. That has been booked. It. Will book Holden, against. That application. And. We can see that booking has been done straight away when, we go back to that application. We. Can see that Holden Caulfield, is now, the, external, reviewer that has been, associated, to. That application. So. I'm gonna switch. Over to my. Backup, video, because, that didn't work as expected so, just. Bear with me for one moment. Because. The next thing I wanted to show you is how, the external. Reviewer logs into the portal so, that this is what you were meant to see so I'll just apply this for now so the booking has happened, and I. Just, quickly. Go ahead the. Application. Has been updated, and that, external. Reviewer has been allocated so. Then the idea is that the external reviewer, will, receive an email they. Click on the email they, will automatically, get redirected to the, application, and you, can see that it's in read-only mode they. Can also add a comment. So. That the applicant. Can see what. Review. Additional. Changes, need to be made but. In this scenario I'm. Just approving. That application. So once. That application. Has been, updated. By our, season Milan. Canine. Will receive an application I'm. Sorry an email that will notify her, that, the external reviewer, has, added a comment and as, you can see the application will, also be in read-only mode, and they, won't be able to update the comment that the external reviewer has entered as well so you can do some security with perhaps portal, to, ensure that only required. Information is updated and with. The external view we can see that it's been updated to approved, so, what I'm doing here now is I'm. Allocating. A nature of your I'm approving, it so, when we hit the. Refresh, button it, will move from review. To approved, and if. The application, should, then appear as, approved. 2k9 and k9. Will also receive a notification email. That. Tells her that the, application. Has been approved. And. So. The idea of the. Flow oops. It's alright mmm. Is. That it. Will, go. Ahead so, I'm just going to zoom out, now. It, will go ahead and effectively. Recognize. At what point it needs to move the business process flow stage from, A to B to C and you. Can do it in a way where, you don't have to use any code, previously. We had to rely. On custom. Development, as. You can see from the dock start Microsoft comm site a particular, API, needed, to be cold.
Does. Anyone have questions before. I move a to my side day yep we've got one over there, pardon. Yes. So everything you seen today including. The flow of parents. Portals and universal. Resource scheduling, is available, today with, universal, reason we're scheduling, the apps. That, you do need is either, the, customer, service. Projects. Service, automation, or. Field. Services, does. That answer your question okay. So I was sorry I forgot to repeat the question so the question from the gentleman over on this side of the room was are these, available, today. Ok. So I'm going to switch over to my, slide. Deck. So that was a representation. Of the, stages that you saw earlier and, so. Just to recap, the end-to-end lifecycle, was using, a parent's portal where. You have an applicant, that can submit an application, you. Also have, the external, reviewers. Interacting. With that application through, the Peretz portal, and we, also have the internal reviewer, doing, the approval within the, model-driven app and no. Matter what platform. All, the interactions, have. Been. Completed flow. Will still go, and do its magic and, move it from one stage, to another. So. In terms of my other sessions, today I do, have, another, flow session, in theatre 9 where, I show, you how to delay. A birthday, email based on the celebrants, local time and, on. Thursday, I do have, an unconference, session, where, I'm car is ending with three other MVPs, Joel. Lindstrom, Sean Tabor and Marco, Emoto so. Please come along if you can, for. Those of you who are interested in learning flow there, are two courses that are available online, today which I highly recommend one. Is for beginners and, one. Is advanced. Tips so if you want to go. Beyond, your basic knowledge of flow I recommend. These two, courses, and, one, of the people today that you see on that screen is, actually, sitting right over there, so, it's, Kent weird he used to be a flow. Program manager, in the, flow team and then on the other side of the PowerPoint. You have John Levesque who, is a senior, platform, evangelist. And, for. Those of you who are sitting in the audience today who, actually do work in an, organization. And you do want to implement flow, for your business, there's, also a white paper available that. Was written by another MVP, Jerry Weinstock, again. I highly recommend, that you do take, a look and you, download it because it's very informative. For. Organization. And that want to get kick-started with, flow. Yeah. So open up the, floor to questions now, if you want to connect. With me again. You can find me on Twitter and on, LinkedIn if you do want to add me on LinkedIn just leave, me a message so, that I know that you've. Come to my session and I'd. Also have a blog and as, I mentioned my youtube. Channel so that's how you can find. Me so. Does, anyone else have questions. Nope. Okay, so. If. You, want, to write my session today you can. Basically. If you've all been scanned by your name. Badges today you. Should receive a notification on, the events app later and for. All the sides and, I think they, are recorded as well you, can find it through this, link otherwise. Thank, you so much for coming to my session today I really, appreciate, it and maybe. I'll see some of you in my, final session this evening thank, you.
2020-01-15 05:34