Create an Approval Process Like a Pro 2 of 7 | Power Automate Tips and Tricks 2020

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
okay so in this video we're going to talk about the benefits of having a dynamic approval process so this is a static approval process and again just going back to our scenario where we have multiple parking lots and within those parking lots we have different approvers and then once the parking lot is approved then there's a special parking spot approval that's required so here we just take one scenario so here we have five lots some just take the north red and then from the north red you will see that there's requests for the approval and from that uh once that's approved if they get a yes then we have to go through find the approval for each one of the special spots and i have five scenarios there and if the special spot is approved then what we do is send the final email confirmation and then if it's denied we send the denial now if i zoom out on this flow you can see how it can be very tedious and and very cumbersome to work with and just understand that what you're seeing here is only 20 of the flow if you're doing this in the static you have to replicate this again for all of the other scenarios in the different parking lots for the different approvers everything's hard coded there's a lot of duplication so if there's one small change it can cost you several hours versus if you look at this one let me zoom in this is what we're going to build in this video in this video this is what i can call a dynamic approval process more so like an engine it has the same requirements it fulfills the same needs it just does things in a more dynamic way to where you only have to build a pattern for how do you approve parking lot requests and then once the parking lot request is is is approved then how do you approve the special types and that's what we're going to walk in this video and if i zoom out if i go through all the conditions here and then i'll just expand these all out zoom out because i have the different approval steps here this is actually a multi-step approval i have the different email confirmations required and what you're seeing here in its entirety is a hundred percent complete so and it's dynamic meaning that you can add an additional parking lot don't have to mess with this you can add you can change the approvers you do not have to mess with this you can add additional special types and you wouldn't have to mess with your flow this is uh what i would consider an engine because it allows you to to maintain it to change its parameters as long as you're changing the data as long as the structure and the flow remains the same this is uh it's a beautiful thing so this is what we're going to build in this video okay so here we go again so again we want to talk about how do we get these approvers for the different parking lots as you can see here so i got north blue executive north red and then i also have these various special types right so once you pick a parking spot you can either say a parking lot then you have to specify do you just need a standard spot or do you need a tesla charger ev charger handicap whatever the scenario uh your car or your vehicle require so if you look back at our flow in the last video we're just very simple straightforward did a lot of explanation on the different flow types and connections and things like that but we ended up with a very simple flow when the item request was created we sent the confirmation email letting people know let the sender know that we received their confirmation and then also we received we sent a request for approval out and then as we talked about this is going to be a starting weight meaning that once the approval is sent they're just going to sit here and then wait now we know that a lot of this information is hard-coded so there's not a there's no dynamic pieces to that and that's our goal our goal is to to build out a dynamic approval process to where the manager of this process can the admin or manager whoever whatever role you want to call it and it's going to manage this process they can easily come in here and swap people out they can add maybe there's an additional lot type maybe there's additional charger type maybe there's a tesla charger 2.0 that charges you know from zero to 100 percent and 20 minutes or whatever the case may be so we know that we want this to be maintainable without having us to come back in here as an app developer and modify the flow we want it dynamic in that sense and that's what we mean when we say dynamic approval okay so let's jump right into it uh so we have their confirmation email we have the parking lot as you can see this is hardcoded to cardo so basically what we want to do we want to dynamically pull information from that lot approver list and to do that i'm going to use the get items action and that's the sharepoint action here and basically once i do get items it's going to ask me what items do i want and the first thing i want to do as we learn we want to get we want to rename these as soon as we can because the later you wait to rename them the more this has been internal reference and you started renaming things after it's kind of built out and things start to break so before you start connecting or adding or referencing the action that you just dropped in the first thing you want to do is just rename it okay so here we go site address i just want to pull from that equipment request sub site and then from there i want to select the lot approvers which is going to be this guy here and again if you bounce back over and look at this a lot of prover is a very simple list i got different views to show which ones i want so let me switch over to the parking lot view this is only going to show me a parking lot approvers and here i just have a type that's just a placeholder because sometimes you don't know what to do with that title site column so you have to get creative or not that creative in this scenario and then here's the approver and then here's the actual parking lot that that approver is associated with so now we are on the same page with the schema once i select the list i want to go down here to filter query and notice that the helper text that they have here they have string column name and equals to and then you can't really see it but they want the value wrapped in quotes so our value is going to be dynamic and basically what we want to do we want to grab where a parking lot and this is this is a trick that i always use so let me go into list settings because i need to get the internal name for this uh site column and the internal name you can only get if you click on the actual column name for that site column and then look up here in the url and that's where the internal name is tucked away and that makes sense right because with cyclones we understand that you have an internal name and display name especially if you're dealing with multilingual sites the display name is the thing that gets translated for those different languages so to be consistent and to make sure that you don't have to put logic and say if it's this language then look for this name if this language look for this thing even though you're representing the same column the internal name is what's going to keep things consistent throughout and it allows you to rename things without breaking them so okay so here i go i have parking lot and then i want to wrap that in the single quotes and then i want to grab the parking lot dynamic field so basically the parking lot value is the lot selected by the requester at the time of the request so when the request is created and and as we build this out my whole speech on and my whole warning on making sure that you pay attention to these headers when you're looking at the different tokens is going to be critical and essential as with this thing grows and you will see what i mean here in a second so here are the parking light values so where parking lot equals the value selected it's only going to bring back that item well it doesn't know this action doesn't know that it's only going to be one item requested even though we're going to say the top count and that's what the top count does right the top count says i may have 20 but i'm only interested in one but this action is not going to matter if it's one or a hundred it's still going to treat it as it's a collection and that's a key thing to note because things are going to get nasty here real quick so once we have that i have my items so now what i want to do i want to set up the approver i only want to send the approver action based on the approver selected for this particular scenario and this scenario only is only looking at the lot right so here i just go and uh wipe out the hard coded hit the dynamic content and now i'm looking for a token it says get lot of provers again pay attention to your headers and this is nicely formatted for me it's filtered i have a lot of different site columns coming back in that lot approver list and this one's only bringing back the three options i have that pertains to an email very cool feature within forms within power automate once i select that notice what happens i get this for each loop so apply to each is just going to loop through this collection again as i mentioned this thing doesn't know that i'm only pulling back one even though i'd specify the top count so now i have to deal with these collections and things start to feel a little uneasy for me and you know because i have this extra thing i have to deal with this is over container so let me do this real quick let me go ahead and rename this what before i rename it there's a safety check you want to make sure to make sure it's safe to rename if i mouse over this approver email which is the only thing that's coming from this particular item and basically what that's what this is doing this is saying for each item that i'm i'm looping through that's in this collection because it may say what if you have 20 entries that match that filter criteria that you specify uh for each one of those 20 i'm gonna go through them one at a time this is the item that selected and based on the item that that i'm on in in that time of the of the loop this is the email address that i'm gonna pull from now i want to rename this because i hate that i'm taking these default names and it's not clear so i'm going to say apply for each parking lot it's a little verbose but is it when you come and touch these things three or four months later this these namings are going to be key but now that i renamed that i want to make sure i didn't screw this up and see they apply to each hold on i touched it let me see the apply to each is sticking so now wait apply to each yeah see it's sticking so i can't do this so what i'm gonna have to do i'm gonna have to start over unfortunately i'm gonna have to leave that name the way it is and i'm just not hold on let me do this let me and here's the funny thing the funny thing about it is that i expected that not to break i expected that to pick up the renaming of the let me say the question is can i add it now now that it's renamed all right let's try it so if i hit approver name mouseover oh wow look at that you're fantastic thank you i was reading your mind so you didn't know that youtube had this two-way communication but no i was i was i think as she was thinking it i was thinking it too so this actually works so i wiped it out i reapplied that token i didn't change anything and it took on my new name now the good news is as i move forward and add these tokens in it's going to take that name again this is why it's so important to rename these guys because you have these internal references that um that sometimes are sticky and as soon as you rename it the internal reference break and flow will let you know it will give you a nasty generic message and you won't be able to understand what it means you and it may not be clear on where you made your error so it's always good to save and check spot check along the way all right so here we go apply to each for each one of those lots in our scenario it's always going to be one we're going to send the approver out this is going to be the approver and then once we have the approver we need to understand how what did they respond so we need a condition so they're going to respond either approve or reject so let's just drop our conditioning here and i don't think can you rename these yeah uh did approve like now here's another thing when you rename these guys these names have to be unique for your entire flow right so when i'm renaming these i'm being very uh that's why sometimes i'm verbose but this uh did approve a lot uh is only in pertaining to the selected light we're gonna have to do this again repeat this process again for the special section if it's approved so in our scenario the way we're gonna work you have to approve the lot first if that approves then we're gonna send the request off to the special parking spot approver because we don't want these to go in parallel where one improves and the yellow one denies or if you can't get in a lot in the first place it doesn't matter um if you're if your parking spot was approved or not all right so once we have this uh what we want to do we want to do uh request approval we want to look at the outcome the outcome is going to be the decision now here's the thing when i send that email off it's going to say do you approve or reject is equal i always was using approved with a d that's incorrect you you will actually this will always be false if you add a d to this so it's just approve no d uh if yes then what we want to do so next if yes we want to send we don't want to send the user a confirmation not in this scenario but you could based on what your scenario your situation may be but in this scenario we want to get all the approvers and then send a final approval confirmation to the user we don't want to send them information along the steps of the way so if we don't need that what we want to do now is just go ahead and send our approval request to the so i'm blanking out so i need to approval all right so starting wait for approval and we want to send this approval request it's going to be the first one to respond in our case again we're only dealing with one and then we're going to say oh i don't know who to send this to and i'm not going to hard code it because we already know the tricks on how to get this thing approved so what we i'm saying dynamically so what we want to do let's do add action let's do our get items again and then basically on the get items i'm going i'm going back to the exact same subsite which is equipment requests and i'm going between a lot approvers okay and then in this scenario i i don't want to filter a lot i want to filter on special types so here i'm here i am back into my sharepoint list go into special spot and notice this is why the internal name is key i have special spot as a display name because i changed it along the way so somewhere somehow but here is where i want to get that internal name internal names are important because display names change they change all the time so here we go uh equal to and then here uh within my token i'm typing the word special and notice how and this is where things get flip-flopped right so um oh wait wait wait so this special spot actually i hope this works i hope this special type reference okay we're gonna have to figure that out isn't this interesting so i have special type here oh oh no these are two separate columns okay so when the request is selected this is the guy i want right so special type make sure you wrap it in the single quotes because that's what the syntax is is referencing that's what the syntax requires once i have that again let's just do our top count one in there for kicks and giggles because it's not going to mean anything uh let's immediately go ahead and rename this so let's just say get special types all right or special type approvers i probably should do something a little bit like that approver okay all right anyway so now we have that actually i want to switch positions with these two it's easy to move these guys as if they're collapsed so let me collapse it and i move that i'm okay with this syntax i'm feeling good there and then go ahead to my start uh start and wait for approver uh let's say uh requests a special spot uh approval all right so let's go ahead and rename that and then from the assigned to let's go ahead and hit the dynamic content get special type approver that's the email address for the approver again i get this for each loop let me go ahead and rename this loop apply to each uh special [Music] type all right and then let that marinate and then expand this out double check my internal name now see notice notice that this this thing is it's hokey sometimes it updates the internal reference sometimes it doesn't what are you going to do just double check every time that's what you do all right so now we have here uh so for the title let's just say uh your approval i'm gonna i'm gonna redo all these titles anyway i'm redoing all these titles these subject lines i'm redoing all the email bodies uh that's gonna be the next video we're gonna show the power of global variables okay in our next video and that's going to get global variables also this is a sneak peak um this is why you need to subscribe this is why you need to like this is why you need to hit the bell um this is a sneak peek of where we're going to do global variables is going to actually clean some of this up associated with these nested uh applied to which makes things nasty and then i'm gonna show you another thing when we test it how things kind of get encapsulated and it's really hard to follow the flow uh global variables are gonna help with that so your approval is needed let me just type in anything here for now your approval is needed for a special spot request very verbose very long we're going to spend some time and get these nailed and very clear and precise okay so for the details uh let's just do we'll just keep this light requester because we talked about how to do this and how we should be using markdown to help style things uh special spot and that's the thing like when you do the global variables it's going to force me to be consistent with these names and consistent with these references requested date and what else we need to know uh as far as a special spot oh parking lot like which lot is this uh this is a special spot supposed to be in because you may have chargers in the blue lot but you may not have any chargers in the red lot available for this date all right so the requester let's just go ahead and do uh created by now look i got 13 000 creative advice okay maybe like six or seven but from there but each created by is different in its own it's in its own right right because and this one this is a special type created by for the lot of provers i don't want that this is a special type again a lot of provers i don't want that and this is the created by for the uh the item requested so the person actually requested this and that's what i want and i want their display name right and then it's for special lot as far as to lot request it uh again i want the when the the request came in that's on the request item the date requested uh let's just do date and scroll through uh start date i should have did a better name on that but that's okay and then for the parking lot and you notice what i'm doing i'm just typing these in so i can filter so that way i'll have to scroll through all three thousand items it's not three thousand i like to exaggerate when i try to emphasize the point okay so parking lot request it okay everything came from this bottom section here when the request was created because all of these items or tokens i'm looking for are information details on the actual request that was sent to us from the mobile app all right so now i can do a link to the item uh let's just do and type in item and scroll to the bottom and i like it because uh if you scroll to the bottom outside of those loops i'll be using landing item in the area that you want so this is requested that's the link to the item and then here this is my text that gets wrapped in the hyperlink link to the request all right we spent a lot of time on something that we just covered in the other video but that's fine just in case you're watching this and the first time i really encourage you to go back and watch the series from the start to get better context all right so here we are special type we got our approver in there uh is looking this thing up from dynamically and now we have another decision to make and again make sure you're in the right loops here um because think again things are getting nasty because i'm all nested now so i want once that's done i want to get a condition to see if it was approved so let's do this let's do a condition and then again test the outcome they like to put that in the outcome make sure you grab the right one uh special type outcome and then approve again without the d and then once you go into if yes now we can see now we have because if i hit this green here that means everything was green my lot was approved green my special request was approved green and now i can send safely the email out to the requester saying that everything is good and so who we want to send this to the one who created the request right so let's just do create it scroll all the way down to the end and let's do create it by email and this is something like your requests was approved and then here we can detail out and just say i'm just put some things in here it's a request uh let's say parking lot again i'm not spending a lot of time on these because going to redo these in the next video all right so here our request is just to start date i think that's what it was and then for the lot we're going to do parking lot again pick the right one and then for special type we got special type just writing the word special all right and again pull my everything from my requested date all right so that's fine and uh i didn't rename this so let's say send final approval email okay so now that's that the next thing we want to do is to handle the the not cases the case where it was not approved all right so here i don't have did the lot get approved no that's going to be this scenario here and then uh send an email and then you can do lot what's not approved so again we're just going right this whole rigmarole of selecting the right created by email which is going to be that one there and let's say your request for parking lot and then here just let's get very uh detail on the dynamic on that uh was denied just put uh was denied and then here you put the details your requests for a lot and then just put in all of this becomes very repetitive after a while right and then here i'm gonna put my dot dot dot meaning that we're gonna fix this up later all right so that's gonna be uh let's rename this though to be very clear on what we're doing at this time so sam uh lot denied email now let me show you this because uh in your mind you're thinking uh can i can't i just copy and paste these like like we were able to do in sharepoint workflows and nyntex workflow so okay here's their attempt so the attempt is you can hit the ellipse hit say copy the clipboard because after a while these get very repetitive and this is why again in the next video we're going to talk about global variables where we can simplify a lot of this but if i if i copy this action right i'm copying this email action just say for kicks and giggles i built that all the way out i go to my condition to where my special lot gets denied i hit add action there's an option here that says clipboard if i click on the clipboard there's the email denied that i have i select that and i get this get id as undefined at times i think this is still in preview i think when i selected to say hey this is some preview be useless with caution whatever but that's why i can't copy these for whatever reason i know they're probably and that's the thing i mean this this uh whole feature updates and all these office 365 applications are fluid so though it doesn't work today doesn't mean that it will not work uh sometime in the near future all right so send email let me just build this out real quick uh created by uh let's go ahead and do again this is this is uh all repetition after a while you're probably bored but that's okay uh we're gonna build this up and we're gonna test it and we're going to make sure we're ready to rock and roll i would say your parking spot request was denied and again the way that this is triggered if they get one denial they're not going to get they're not they're never going to receive two right so they're going to receive either or so send special parking lot requests deny email let's make sure we're saving without errors cool all right so now what we want to do let's go back to our lot let's see if how we can test this i think i have enough enough personas in place to really get this a really good test to kind of show the different scenarios all right so now what we're going to do let's let's try the executive corner parking spot so here we do our trustyo application our mobile app here and what i'm gonna do i'm gonna do the executive and then for my special light i'm gonna go with um let's go with the tesla charger so kevin all right so i got ashley approving the first and i have kevin approving the second all right so now that's executed if i go back to my power automate and let's see this should kick in here in a little bit and i'm waiting for the status uh so wait for this to kick in so as i mentioned before sometimes these take a while to kick in uh so why are we doing that we know ashley's gonna get the first request so let's go ahead and jump ahead and log in as ashley so here and this is why it's important to have these test demo tenants right you can test with different personas you can really give your your application a really good test in many different scenarios many different roles you need multiple users to do that you can't do these types of detailed tests these types of even unit tests right you just sanity checks you just can't do it with one email with one login you have to you have to have different personas especially as an app developer you got to have different personas and i would take it one step further and say you really should have a separate office 365 dev tenant that you can play with because there are certain things that's in the admin section or the security and compliance section that once you're at your organization or at your clients location you will not have access to execute all right so here we're running we don't have any errors let's just double check all right so send confirmation i should have got a conf i should have received the confirmation there sent a lot of approver uh here let's just see that's my request going in this parking lot let me look at the output now this seems like uh gibberish actually if i think if i had a json reader plug-in install of this this would probably make it a little bit more easy but what i'm going to do um i'm searching through to see the exact so let me do this let me do ctrl f and here we go executive parking lot there we go ashley so she should have received the request so now if i go here there we go pending approval all right we again we just put some stuff in here this will work uh so let's do this let's just do the reject 2 4 try a different date hit submit and that's going to execute so now if i bounce back over to my persona um let me go here let me go out there we go outlook all right and there we go there's my denial and i got my dot dot just a placeholder say we need to figure this out later all right so now let me do uh let me submit another request okay fine let me see who do i have access to let's let's work backwards all right so christian benjamin ethan andre okay let's do north blue i have access to andre all right so let me go here parking lot put this in all right north blue all right and then tesla okay and then random car okay and close all right so now we got north blue and again this is a good test just letting you know that our query uh to select these different lots are is working correctly i'm only receiving one email which is good because you know that for each loop i'm stopping at one and i'm making sure i'm only doing one touches and that's not the reason why i'm receiving one but that's a good littmann test the reason why i'm really receiving one outside of the top count being one i only have one entry for for that lot type right so if i have multiple entries i will receive multiple approvals and i will show you here in this uh in the next video with global all right so north blue oh i should have been logging in with andre sorry well global variables uh you can simplify a lot you can actually get a little bit more uh powerful with it and you're definitely going to get consistent right because everything that you're going to reference is going to be in the global variable you said it once and you use it as many times over and that's just going to be the right way of doing things right it's going to keep your maintenance down it's going to ensure consistency and and that's that's usually the key thing from the business user they want the messaging to be consistent and we didn't talk about branding the emails like how do you do send an email with an intern with a branded logo and maybe a grid format or you know in our case we're not even doing a lot of the markup or styling markup or markdown right all right so here we go uh dang it man uh let's see let's click on outlook all right so again for andre your approval is required from north blue uh let's just do the happy path let's go ahead and approve it oh oh what in the world oh this is straight nasty how come i'm not getting the embedded approval oh that wasn't good this looks good i was in preview mode and it took me to flow and that was the one thing about that approval action for apple users with like apple phones or apple users using apple phone and the apple mail client that proved you just didn't get that embedded experience over time that got worked out and uh it was a beautiful thing but before it was it was a struggle it was nasty it was nasty okay so my lot was approved now i'm going to uh tesla so let me look at the special type tesla's going to be kevin all right so let me go down here hit the guess all right so now we're logged in with kevin and go to outlook and here we go so special spot so now i got my approval for the project i got my pr parking lot i got the approver for the parking spot and now we're done so just like that if i bounce back over to um to this flow just take a closer look at this and see what happened so as we look through this we have just a handful actions just a handful actions and all of these right if you look i'm in their collapse state all of these well you want to show that one it's dynamic this is this is like an approval engine if you would it will approve anything any scenario uh whatever you need it will approve it if you need a different lot if you have a new lot if you have to switch approvers it would do that when actually if you had multiple approvers because you wanted to send it to two people in the event someone was out and your process is not hinged on one approver for any given type we have to tweak our schema to allow for multiple approvers we have to tweak our flow to accommodate that but in the end i think that's a 10 percent tweak you can make it you can easily uh transform this into uh a proven multiple different types so again uh very very powerful it's is one of those things that uh once you get it right once and once you get comfortable with the pattern you won't build anything in a different way would that requires you know a multi-step approval process so it gets different people configurable and managed through a sharepoint list okay we still got more work to do to clean this up let's jump in that in the next video any questions any comments any sticking points leave them in the comments section um i'm open to it again subscribe like uh hit the bell for the reminder so that way you're on top of it every time we drop a new episode in this series all right talk to you soon see you in the comments section [Music] you
Info
Channel: DeShon Clark
Views: 2,989
Rating: 5 out of 5
Keywords: spEasyDev, sp2013, sp2016, ngsharepoint, custommasterpage, sharepoint2013, sharepoint2016, sharepoint, sharepointandangularjs, odata, sharepointlargelists, office 365, o365, share point, sharepoint 2013, ofice 365
Id: iv-bNuye6Hc
Channel Id: undefined
Length: 38min 50sec (2330 seconds)
Published: Thu Sep 10 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.