Using #ServiceNow Flow Designer when you disagree with OOB logic
hey everyone welcome back to my channel it is so good to have you here we're here for another episode of go with the flow the series where i try and teach you something useful about flow designer with as few video edits as possible today we're going to use flow designer for situations where you disagree with what is out of box so the one thing i want to make sure of is that when i disagree with the out of the box i can get things my way without opening the out of box components if a business rule is doing something i don't want to have to edit that business rule to get what i want and so i'm going to use something a service now does in itbm or i think they call spm now that i have disagreed with for years and use flow designer to solve that problem this is a resource plan and on a demand or a project what a resource plan allows you to do is ask for a certain time commitment from another team so this one is asking for the commitment between month 6 and month 10 and it's asking for 40 hours and it's asking it from the servicenow team now the servicenow team has a bill rate in servicenow so just asking for those resource implies a cost so if you look down here we see that the requested allocations there's five of them because it spans five months and it's come up with a price so that the total estimated cost of this resource plan is 4 800 super handy now that the resource plan has been created servicenow is going to create a cost plan on the same project so here i am on a project i scroll down i see a cost plan and to the naked eye this might look just fine we see this the right amount but its cost type is labor capex and when you're looking at things from a financial perspective you always have to prove capex there's differences in the way finance handles opex versus capex capex incurs certain privileges so for companies that do a lot of auditing on their financials for example you want to be very careful what you put into capex especially if it's labor so a lot of people for a very long time have wished that resource plans didn't default to a cost plan of labor capex and that's what we use flow designer to help us with today so here i am on flow designer i'm going to click a new flow and we're going to call this resource cost plan corrector so the first thing i want to do is define a trigger and the trigger is going to be whenever a cost plan is created so let's add a trigger and let's say a record is created and we want this to be on cost plan we don't care about trigger of the record being updated because we're really going to define that cost type once now we do want some conditions on this the first condition is we want to make sure that this cost plan has actually been created by a resource plan we don't want to be fooling around with any cost plans that we're legitimately putting in as labor capex manually or via some other mechanism so let's make sure that the resource plan of the cost plan is not empty okay i'm going to add a second condition here and this is a good habit to get into i'm using the flow designer to basically fix something that i don't agree with out of box but i have to leave open for the fact that servicenow could fix this so that it defaults to labor opex so what i'm also going to do is condition out cost plans that are created as labor opex because i won't want the flow to actually trigger in those cases so let's go cost type is not labor opex all right so what do we want to do when a cost plan is created as labor capex from a resource plan well the first thing we're going to want to do is change that cost plans cost type to labor opex so let's go action update record and what record we're going to update we are going to update the cost plan that triggered the flow so drag that record onto the record and it automatically knows the table now we got to fill in some fields so let's grab the cost type field and where we're going to set it to we are going to set it to labor opex so we got that action done now another thing to consider is i want to make sure that this update is as visible as possible i don't want it to be a secret that this workflow has gone to the background and changed something that is usually out of the box behavior so let's also update the work notes of the project that this cost plan is associated with so let's add another update record but it's not updating the same record it's updating a different record so it's update record what record are we going to update we're going to update the top task of the cost plan record that's the task that this cost plan is associated with and since top task is in the table task let's capitalize on that and grab the work notes field and we'll explain what we've done here in the background for anybody who's curious uh about the project cost plan and let's put in quotes the cost plan records name has had its cost type changed to labor opex by flow and let's grab the flow's name and drop it down there and that way if in fact this was a mistake we at least have a log of it happening so let's click done and maybe i'm also going to want to annotate the resource plan to make sure that there's notes there too so let's update that record so we're gonna go update record and what record are we gonna update we are going to update the resource plan of the cost plan so we go to cost plan pull that resource plan pill and we'll go to add value grab the notes field and we'll say cost plan and let's grab the cost plan's name again cost type has changed to labor opex triggered by flow resource plan corrector okay it's a simple flow but it allows us to get the results that we want when we don't agree with something that the other box does so let me save this and i'm actually going to activate it and we're going to test it live activate here i am on a project i'm going to create new for a resource plan we're going to request resources from the servicenow team and we're going to pick 40 hours and we're gonna submit that request okay it's the same price let's go back to the project here we are on the project let's take a look at that cost plan labor office mission accomplished okay so now what we want to do is make sure we go to our instance documentation to write down what we just did you are doing documentation right right all right so here we are in the documentation i've gone to the cost planning section of whatever document is forming my memorialized stuff for my instance i've made a new subsection here called cost plans generated from resource plans we have an explanation of why we needed to build this we state out-of-box resource plans generate labor capex cost plans this is in violation of our finance principles and makes it harder to budget our labor appropriately the cost plans have accurate numbers but an unwanted cost type no out of box objects for modifying this feature i've then gone ahead and referenced the story that authorized us to do this put a little message about why you could copy that right from the store if you need to and now i'm just gonna make sure that the object is linkable so i'm going back to my flow resource cost plan corrector just gonna dump that into my document there then i'm gonna go back to my flow designer i'm gonna grab the url and i'm gonna come back into my dock right click hit the link embed the hyperlink so i've just described an abstract why we need this so that a product owner who's not a developer can figure out why this was made i've linked to the story that justifies why it was made and i've linked to the objects that i've made and i did that in seconds there are people out there that are going to tell you that this is hard anyway there you go folks another go with the flow where we use flow designer in a very very simple flow in order to do something to fix an out-of-box functionality that we disagreed with hope this provides some value to you and i will see you on the next one if you're a servicenow expert looking for better opportunities but maybe your resume or linkedin profile isn't doing you justice reach out to me via linkedin or the email pictured here as i offer both career coaching and recruitment services and if you're a servicenow customer or partner you heard that right robert fedoric now does servicenow recruiting with a 1 500 subscriber youtube channel and mailing list and thousands of linkedin followers let's make sure your open positions get first go with the prodigious pool of servicenow resources reach out via the emailed picture here
https://www.youtube.com/watch?v=aD3htEQUhxM