Automate & Enrich #ServiceNow Project Status with Flow Designer
hey everyone it's robert fedoric here with another go with the flow this is the series where i jump right into flow designer i do as little edits as possible to my videos and i try and build something cool for you guys in flow designer in this episode we're going to be talking about project management and uh if you've ever done project management deployments or worked in itbm or worked with a pmo you know that project status reports are a big deal and what sucks is the project managers have to create those project status reports manually so we're going to use flow designer to take that labor out of the system and we are also going to make the experience a little bit richer by adding some important information to the status reports so that when the pm gets there it's already loaded with useful stuff so let's go to flow designer and the first thing we're going to need to do is establish a trigger now i don't want this to happen transactionally i want this to happen for every project managers open projects every single month might be different for your pmo you might do weekly it's just whatever works for you so we are going to do a trigger of monthly and we need to select the day that it runs on and i just learned very recently that if you pick the 31st then that acts as end of month for months that have less than 31 days 13 years i didn't know that until now so we're going to run it on the end of the month the 31st at 6 a.m so let's hit done on that so what we want to do is add a project status to every project in a certain set of criteria so we need to look up those records before we can do everything for each of them so let's look up our projects we're going to do that with the action of look up records and we are going to do that for the project table now one thing i've learned is if you just search for project there is like a lot of tables but if you do something like name it by its database name so let me do pm underscore project it's a little bit better but a bigger list but what i've also found out is if you can use these square brackets pm underscore project there now i've got one result which is awesome that will work extra extra awesome when you're working on super super common database titles like risk or cmdb so we have some criteria for the project obviously we want active ones we don't do project stash reports on inactive ones and we also want one where the state is one of open or work in progress we do not want to be building stash reports against close complete close skipped closed incomplete nor do we want to do it on projects that are pending just for the purposes of this example i'm just going to hard code this so it only works on one project so let's save that okay so now that we've looked up the records we need to do something for each of them so let's put in the flow action so let's put in the flow logic of for each and flow designer is not going to make any assumptions about what set of records we're going to do for each for so we've got to tell it explicitly use the project records that i established in activity number one so we're gonna grab that activity in one project records drop us in here so now it's ready to do something for each of the records that it found in that lookup records we'll it done okay now comes the part where we want to get data to enrich the project status reports with that means we are going to be looking up all kinds of other records now if you work with project you know there's all kinds of related records there's risks issues decisions actions changes cost plans benefit plans just tons and tons of different related data and we are going to use risks issues and changes for this small example you can use whatever you want as well i'm going to show you a trick here because we don't want to look up three sets of data in sequences and look up this then look up that then look at that what we're going to do is look at all three of them up at once so to do that we are going to use another flow logic called do the following in parallel this is excellent for tasks but in my case also good for lookups so now that we have do the following in parallel within that node we are going to do our first lookup so action look up records and the first thing we're going to do is look up on risk this has the same problem as before when i say risk it's all these tables so we're just going to wrap those in the square brackets and there's my risk table nice and handy in the search now risk is a funny table it doesn't have an active so we're gonna have to we're gonna have to search for the open risks via state so we're gonna say state is one of pending open or work in progress and we also want state uh risks without mitigation plans because that's going to be super important for our pm so we're going to say mitigation plan is empty and we also have to make sure that they are risks for the project that we are in at this point so we need to make sure that the top project or the top task rather is the exact project that we're at in the for each loop so we are going to be look for for each loop and we're going to grab the project record that we're on okay we're going to drop that into our top task and that's how the flow designer will know iteration after iteration which project to make sure it's grabbing the related records for we're going to hit done and i don't necessarily want to duplicate a whole lot of work so let's take that and copy it so let's open that one and instead of risks on this one we're gonna grab issue in this case we're gonna do active is true and state is one of pending open work and closed also we want only high priority one so let's go priority is one of critical or high and what else do we have to do for issues we have to make sure we're only getting the issues for that project as we learned before let's go to the top task and make sure that that is the project record from the for each iteration that we're in so here's our four each grab the project record bang okay now we've got the problem where we have these long lookup titles and i want to make sure that i'm a good steward for those who come after me so let's go ahead and document these with an annotation so let's say this one is unmitigated risks okay that way somebody can read my intent without kind of understanding this long string okay and then this one is high priority issues okay let's give this one a copy now we have a third lookup and this one's going to go against project change requests so let's change our table to project change request again we want active is true and we want a state that is one of pending open working cl work in progress and we want to make sure that the project change request is linked to this project we don't have a top task column in change we only have a parent so this is where it's going to be a little bit different parent is so again we take our for each section here grab the project record and that ensures that it puts the sys id for the project that we're already on and then let's change up the comment here this is open project change requests all right now it is time to bring all of this together on a project status report so outside of our do all the things in parallel we are now going to create ourselves a record we're going to use the flow action of create record and we're going to annotate this with project status report so those that come after me can quickly eyeball this and understand what's going on and we're going to use the table status report it's labeled status report but his database name is project status all right let's fill in some fields okay the first and most important is that this project status gets linked to the appropriate project now we've done that a whole bunch of times in this video already this should be second nature to you so let's pick the field of its parentage i believe that's project and then we're still in that four each right we're still within this four each so we still use the for each project record there now we know that our stash report is linked to the right project now remember we did all those lookups so that we could utilize that data in our project status report so we want to fill out our executive summary with that data my neighbor's dog is barking like crazy i hope you guys don't hear that so we're going to populate the executive summary field so i'm going to say write your executive summary here and then let's put some automated metrics here and the first thing we're going to tell them is the number of unmitigated risks and how do we find that well let's go to our lookup for the unmitigated risks and let's grab the count let's drop that now let's grab the high priority issues high priority issues and then we'll grab the lookup for that which was number six issue records uh but we want to grab the count seems like it doesn't want to drop it into this editor the right spot so i've got to drop it in at the top and then drag it not annoying at all and now let's go open change records and we use our lookup for the open change records but we're grabbing the count we'll drag and drop that in all right so that should put us in good stead so we've told the project manager that we want them to write their own executive summary but we've also provided them with some meaningful information within that executive summary so let's hit done and now it's time to give it a test the test hit run test now that the test is completed i want to go view the results so i am going to go right down to the create record because we see that it did create that project summary and let us go actually open the record which is one thing i just love about testing uh flow designer you can just open open the record right up all right so you can see that it's got all the dates right it's linked it to the right project and it's put in our text so write your executive summary here and it's also populated the information that we wanted saying that there was two unmitigated risks two high priority issues and one open change record all right folks and there you have it using really simple components like look up records and do in parallel and for each and then exploiting those lookups by dropping the information about them into a description field we could make the lives of our project managers a lot easier by eliminating their need to create project status reports manually hope you got some value out of that and i will be glad to see you on the next one one more thing folks i just want you to know that i am just like you i have spent 13 or 14 years in the ecosystem and i know what it is like to want to step up in the world i know what it's like to want to know whether opportunities are out there i know what it's like to be undervalued and so if you feel that i want you to come to me because i do recruiting now a number of companies have told me to be on the lookout for good talent and also if you are one of those companies that's searching and searching and searching for servicenow talent you're tired of the regular providers who better than somebody who has been in the ecosystem as long as i have who knows the product as well as i have to search for and vet the talent that you need when you work with robert fedoric you're guaranteed that the candidates i give you are already fully vetted hit me up at the email you see here
https://www.youtube.com/watch?v=gIPq0czKkDM