Basic Catalog Flow with Timed Approvals with #ServiceNow Flow Designer
this episode is brought to you by sacon which is on my list of apps with the most potential for game-changing savings talk to your organization's mobility manager and they'll tell you the nightmare of managing multiple carriers per country each with their own offerings contracts and integrations sake sakon abstracts and manages this for you eliminating the swivel chair mobility management work and giving you asset and configuration data you can trust sakon is mobility managed check the description below hey everyone welcome back to another servicenow go with the flow my name is robert fedork it is so good to have you here today we are going to cover a very basic flow designer for a catalog item but we have one interesting twist and that is that we are going to auto approve by a certain date now sometimes you find in the work world that there are cases where people know that hey 99 of the time i am going to approve this so in practical terms you're almost dealing with a paradigm of if i don't reject it by this time then just assume it's approved so in this case we're going to deal with a workflow covering changing your mobility plan from your personal to corporates the idea is you're taking your phone everywhere and you're using it for work purposes and they are going to cover the cost of your plan so the workflow here is get the plan info from the catalog item that we're submitting determine if it's an international plan or not and if it is an international plan run an approval if the approval rejects we're going to send a communications task to kind of make sure we don't ruffle the customer's feathers and if the approval is approved then it is going to do the next two tasks in sequence for this work but the real twist we're going to engage here is the fact that there is a cut over date and if a decision is not made by the cutover date we are going to assume that it was approved so we've already started a flow here called switch mobility plan to corporate and the we want to make sure that it is triggered by a catalog item so let's go to add a trigger let's grab service catalog and i just want to comment this this is a great habit to get into when you're on your flows is adding an annotation it just adds some nuance and flavor to the actions and triggers and flow logic that you're adding to your flow makes it easier to understand for catalog item switch mobility plan to corporate okay so if you haven't built a flow for catalog items there's one really important step that you got to take first and that is to get your variables so we're going to take an action and we're going to get the catalog variables it's going to ask us get your catalog items from where okay it's a good thing we have our trigger where we're creating a requested item record and that is where we're going to get our variables from then it asks us what template to use like which catalog items variables are we going to get and this is where we've actually got to pick a specific catalog item switch personal plan to corporate and which variables do you want to grab all of them and now since we've done that we've got this get catalog variable section over on the right-hand side of our flow designer and that means we can pull the variables whenever we want them so now that we've collected the variables and are ready to use them let's check our process again and the first thing we got to do is find out if it's an international plan or not so let's add some flow logic whoops sorry flow logic if statement and we're going to ask if if international is true now let's grab the variable from our get catalogs variable data section here so international plan that looks promising let's drag that into condition one and we're looking for that to be true so now that we know that the international plan is true now we have to initiate an approval so we've got this little branch here this is happening if the international plan is true so we're going to add an action let's ask for approval okay and it wants to know what record is getting approved once again we're going to our trigger section which has created a request item for us we're going to drag that onto the record section now it knows what record is being approved or not now we're going to look at our approval rules in this case we want to approve or reject whenever anyone approves or rejects so the assumption here is you might be sending this to a team of people to approve and any one approval or one rejection will cause this thing to take the appropriate path the next thing we are going to do is add a group to the approval so let's pick the mobility group and flow designer approvals create a little bit differently than in uh legacy workflow and we're gonna see that in the latter half of this video okay and here's where we're gonna do our plot twist remember we only want this to uh we want this to automatically approve basically if we reach the cut over date what's the cut over date look at our get catalog variables and there's a cut over date variable so the due date let's say approve if pending by an actual date of the cut over date drop that in there and what this is going to do is automatically approve it if we get to this date you can mix this up a bit you could say a relative date so maybe i say i want to automatically approve it if it's five days after the cut over date or what have you there's a lot of flexibility here you can also go in the opposite direction and reject or cancel the approval entirely so at this point we're going to hit done and from here it's just building out what you would normally build out in a workflow we got to have the tasks so if ask for approval the next thing we need to do is figure out what the approval was or not so let's add another if statement here flow logic if and we're going to say if rejected remember because we want a separate path for rejection uh instead of uh approval so we are going to say if the condition is rejected uh what's going to tell us if it's rejected or not probably the approval so let's go down in our data sets here and let's go to the ask for approval section and we're going to grab the approval state and we're going to make sure that that is rejected and what are we going to do if it's rejected we are going to create a catalog task so to create a catalog task i just come in here go to my actions free catalog task okay what request item is it gonna be related to again we're gonna go up to our trigger section grab the requested item drop it down there what's the short description gonna be communicate mobile plan transfer rejection for and let's figure out who requested it i think in the variable section we have something that can help us stop there the plan holder actually let's grab the plan holder's name so we're going to expand that and we're gonna grab the plan holder's name this is so that when we're looking at a giant pile of these tasks we can tell the difference between them i definitely want to send that to an assignment group don't we so let's get the assignment group in here and let's pick the mobility team and we could put in fancy descriptions or whatever we want at that point and then if we want to select variables we again have to pick the specific catalog item from which to pull variables from so let's go switch and let's take all the variables that were on that catalog item and put in the catalog task now if you haven't done a lot of flows for catalog items it's really important that your flow be well terminated special thanks to joel olives for giving me that term what we mean by well terminated is if we just leave it here after it's done that task it will proceed back down the rest of the flow so if we find ourselves down this path we want to end the flow in this path so we're going to click this button and we're going to go to flow logic and we are going to put an end flow in here incidentally you want to be really careful with end flows especially with the san diego flow diagramming tool more information on that is going to be way up there at the top of the video there's going to be a little thing that pops up on youtube be sure to check that out okay now that we've ended the flow in the rejection path we want to know what happens if it's either not an uh an international plan or if it's an approved international plan let's go to add action flow logic and subflow let's add an action and we are going to do another catalog task remember i love annotating stuff so for this catalog task is going to be switch plans what requested item obviously we're going back up to our trigger service catalog which has created the requested item for us put that in there what do we want in the short description we want something useful in the short description don't just put static text put your variables in here corporate plan transfer for and let's grab our plan holder's name uh name for carrier and we're gonna grab the carrier of the plan so that's a variable let's do carrier and let's just put the cut over it on there too on cut over date and that makes sure that if the mobility team has a hundred of these in the queue it's obvious which one you're working on just by looking at the short description what team is this going to go to obviously we need to pick the assignment group and we're going to pick the mobility team again we need to pick a template for the variables which is the catalog item so we're going to pick our switch personal plan to corporate grab all those variables put that in there and then we're just going to copy this one and instead of switch plans this is going to be called a send to send new terms of service and instead of this short description send new tos to and we can take the rest of this off we don't need the carrier or the date and we've got the variables this is a great advantage it got us from copying and we'll click done there and because we're excellent stewards of our flow we're also going to pick the error handler and action we are going to create an incident so that's under the create task the table is going to be incident and the field values we're going to populate the short description as grab the title flow failure on and we're gonna add a description we're gonna put the actual error code in the description because we've added the error handler again we've got this error handler section on our data list code we're gonna put the code message we're gonna put the message now we've got a great incident in case this flow fails now let's see how this works when we run the test here's a request item that i built in anticipation of the test it has an international plan of true so it should be going through the approval process but its cut over date is a couple days ago as of the recording of this video so this should bypass the approval or at least do something such that we don't need to wait on the approval let's go to the flow designer and run the test we're using this requested item let's view the execution details okay so it got the catalog variables it evaluated if the international plan was true which it was and then it asked for approval but it's already completed that process and it has gone on to create the first catalog task so let's go back to that catalog item and see what it looks like so we can see that it's made a group approval record and an approval record for each of the people in that group this is a little bit different from legacy workflow if you use an approval activity in legacy workflow it won't create the group approval it will just create the approvers in standard workflow it will create a group approval if you aim the approval out of group and it will create approval records for each of the users in that group it's a little bit different okay now the other thing you'll notice is that the group approval says no longer required and the same thing for all of these approvals so it has created the approval records that it anticipated needing but because we told it if you're past that date the approval doesn't matter anymore so it's marked those approved approval records not as approved but as no longer required that's a nuance that i think adds a lot of power because it could show you kind of your record of hey do we actually do approvals here or do they just generally get to the point where they're not needed anymore and then it's gone ahead and created its first task which when we close it will go through the rest of the flow and there you have it folks a really simple catalog item workflow took us no more than five minutes or so to build and we put an interesting twist in there because now we know how to automatically approve or reject stuff based on an actual or relative date that we can get from anywhere else in the flow just a quick message here i want you to know that i am like you i am a servicenow resource i've been in the ecosystem for 13 years and i have done a lot of jobs in that time i'm like you i've been in every role imaginable i've been a ba i've been a developer i've been an architect i've been the person out looking for the next best opportunity and i want you to know that i do recruiting now so if you're a servicenow resource and you're looking for a step up into your next awesome role i'd love for you to consider me to help you on that journey and if you are looking for servicenow talent what better resource to find the talent for you and to vet them as only a servicenow expert can so that when you are given candidates for your search they are only legit candidates that meet your match i'm robert fedoric and i would love to be your servicenow recruiter
https://www.youtube.com/watch?v=sRtnUkV0UR4