NOWCommunity Live Stream - Topical Deep Dive - Flow Designer Basics

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] [Music] good morning good afternoon good evening wherever you are and whenever you are welcome to the community live stream my name is chuck tomasi senior developer evangelist at servicenow and i am here with another episode of the community live stream today is august 20th 2020 and our topic today is flow designer basics and i appreciate you joining me just doing a quick double check to make sure everything is looking good hey we've got audio we've got video we've got streaming i wasn't sure what was going to happen because there were all kinds of variables that were going on just moments before the show and you know me one man show anything can happen so thank you very much for joining me this is the show that brings you the insights the reverse engineering the journey of discovery that is based on the servicenow community content and the questions you bring to me so thank you very much for that we've got lots of great content coming up today and in the upcoming days and weeks join me every monday and thursday at 2 p.m utc that's 7 a.m mountain time well no i'm sorry 7 a.m pacific arizona is one of those places in mountain that doesn't change its clock so weird bit of trivia for you uh that would be 10 a.m eastern as we go through these uh march to november daylight saving time what would that be 3 p.m in london 4 p.m in berlin i think that's cest 5 p.m in moscow 6 p.m in dubai 7 30 p.m in india you get the idea so join us when you can do the math 2 pm utc and then you can adjust from your time zone there thank you again for joining me this is let's uh let's go through our pre-roll this is broadcast on youtube so if you're doing the youtube thing thank you very much for joining me we have a boatload of people out there we're gonna have to get a bigger boat to quote jaws those of you that remember the movie click like subscribe helpful link all that stuff that you normally do because that's what you do on youtube right and thank you very much to the people who have added this channel as a subscription there is lots more wonderful content coming out than what just than what i just put out uh if you click the notification you get the little subscription thing that says hey we are live it's happening now so thank you for that i'm going to make sure my phone is off so i don't drain the battery by the end of the show [Laughter] we also do this on twitch as a backup plan if you're watching there i do try to keep an eye on the rolling comments as we go through the show there's sometimes a lot of people here and it's hard to keep an eye on that conversation it takes out a life of its own and people are talking amongst themselves that's fine that's wonderful that's part of the community and i often look there if i get stuck and say never thought of that or somebody sends in a discussion it's a wonderful time can't keep an eye on twitch though i'm going to work on that i'm trying to find a way to get a chat aggregator for those two if i find that i'll let you know until then good morning to everybody who's joining it lots of familiar names thank you for joining lots of new names that haven't checked in so we do that as i mentioned this is based on the community if you haven't done so please ask your questions in the community pose your questions your problems there are various sub-communities i invite you to look there make sure your content is in the right subforum so that you get the right target audience to answer your question that way you're asking performance analytics and reporting questions in the right place and you know developers may not know everything there is to know about reporting you might get lucky but maybe not or grc or secops or itsm or whatever it happens to be there's probably a forum for it so check there first also remember to search for a similar question before posting i've seen a lot of questions in the past that were just repeats of others so play fair be nice and everybody wins on the community at community.servicenow.com this episode as i mentioned is on flow designer basics so if you've got questions that go beyond flow designer basics boom that's the place to put them is on the community at community.servicenow.com i also invite you to go over to developer.servicenow.com get yourself a free personal developer instance and check out the api start playing around with paris the paris release is not generally available yet but you can check it out on the developer instances over at developer.servicenow.com i should probably throw in the desk bell when i mention that gotta have fun throwing the sound effects very good morning to everybody who's joining me still seeing people coming in on the community that's part of this pre-roll right to give you a chance to oh my phone announcement went off i better check out what chuck's talking about so i don't start the content content right at the top for that very reason give everybody a chance to get in here and also remind you of a number of things like meetups we've got three meetups next week for minneapolis pittsburgh and was it utah let me check 25 26 27. i was just looking at this calendar yesterday and i'm trying to remember utah is on the ninth pardon me 26th is minneapolis 25th is tampa bay and many of these are happening during work hours so you don't have to take time away from the family just ask your boss for permission to say hey i would like to why is my scrolling not working quite right oh i got it all right join the many people in your time zone and maybe outside your time zone i'm not in tampa bay but i will try to make it i may have a commitment that time but i will try to make all of them that i can that are within reasonable time zones people still check it in good good good love to see it that's over at meetup.com pro servicenow dev program also just another quick reminder if you've built applications and you'd like to help out the covet situation please go over to bitly slash tell us about your app and register just fill out the quick questionnaire takes only a couple of minutes and we will donate fifty dollars for each app up to five apps that you let us know about and you win we win people with covid win because this doesn't look like it's ending anytime soon this is august and we're hearing some pretty grim forecasts so again people be safe do the smart thing social distancing wear a mask and let us know what apps you're building it doesn't have to be a covet app by the way you could be building an app to track murder hornets something else something else that's very cheerful right now whatever it happens to be it could be your uh in operations it could be in sales it could be uh in i.t just a lot of great innovation happening out there and we'd like to hear about it and pay back the community a little bit for it the breakpoint podcast had another new release yesterday if you haven't picked that up go check it out dave slusher and i are talking about the new features in paris are mainly around flow designer and integration hub very exciting stuff we look forward to sharing that with you if you haven't done so already go over to bitly slash sn breakdashpoint and you can find all the different ways you can subscribe there's also now a breakpoint page on the community so as new episodes are added that that page will automatically be updated so you can listen on the community you can listen on your mobile device you can listen on your desktop by going to that url and just hitting play on the playlist there's a number of different ways and we have a bonus episode this is supposed to be every other wednesday but it just seems like there's way too much to talk about and i might have to back that up every wednesday but i didn't want to put myself under that kind of workload so i am promising you every other wednesday and i will hopefully get some bonus ones in there like we have coming out on the 26th and that inspired ideas for even more content so look forward to seeing you there talking to you just some open conversations audio only so no power points no demos no update sets you just sit back and listen to a couple of friends chatting and it's a good time our next tech now episode is coming up real quick september 15th seems like we just did one well we did just do one on tuesday about building now experience components with wolf and now we've got jiminjot coming in to tell us about the upgrade center and all the wonderful things to simplify your next upgrade so paris makes it so easy we're really focusing on getting people the maximum value out of their platform by getting to the latest release sooner there's no sense waiting a whole year to do your upgrade and go well you know i think i'm going to skip orlando and go to paris i think i'm going to skip paris and wait for quebec now you don't have to skip any more if the upgrade cycle is shorter get that value pay for those features that you paid for register over at bitly slash tn79 reg i try to keep this simple i try to keep this consistent you can go there and find out more uh we're going to skip the stuff on coding because there is no code today and we're going to get right into our example so flow designer basics let me tell you a little bit about flow design before we get going this episode is really targeted towards a couple of major personas one people who are new to the platform and just learning the basics of workflow how do i automate my process how do i get an approval how do i check these records every night on a scheduled basis flow designer is great for those the other one is for those veterans it's obviously for lots of other people but the veterans of the platform like me who have been around since time immemorial you remember bef practically when servicenow was a command line thing okay it never was a command line thing but pretty darn close we didn't have graphical workflow way back when but the veterans who normally reach for a business rule or a scheduled job or write some script to do a special thing this is for you i know i've heard some people say you know i one of these days i need to check out flow designer i'm here to help you exercise that muscle okay when i was just a quick analogy about home projects tile i never tiled a bathroom before but once somebody shows you how it's pretty easy and this is kind of how flow designer is i'm here to show you how to build a couple of simple flows and you take it and run from there it's a wonderful thing so if you're one of those people then please join me if you're not well if you're already familiar with flow designer i encourage you contribute let me know if i'm saying something incorrectly because that happens all the time you might catch me on something or contribute something in the chat all right uh yeah steve mentioned that breakpoint can also be found in spotify spotify apple podcast google podcast i've got it submitted to amazon it's all over the place wherever you find your favorite podcast that was just sort of a central place to go and go oh look there's a whole bunch of links tune in stitcher yeah it's all over the place okay so what is flow designer probably should have started with that flow designer i'm going to read this right from the definition that's on the docs page at docs.servicenow.com flow designer is a now platform feature for automating processes in a single design environment okay keep that in mind flow designer lets process owners use natural language to automate approvals tasks notifications and record operations without coding okay flow designer no coding there's an option where you can code but you don't have to you can build custom actions that may use code but you don't have to okay so keep that in mind now in many cases you can and should use flow designer this is the part that i'm retraining my brain on because my i've been using the platform for so long that i i kind of get in this mode of oh i want to do this that's a business rule oh i want to do that that's a scheduled job no no gotta retrain those muscles instead of business rules flow designers instead of scheduled jobs flow designer instead of incoming email actions inbound email actions where you're scripting and doing things with records flow designer catalog item workflows flow designer okay instead of legacy workflows flow designer i know it sounds like the wonder tool that slices dices and makes thousands and thousands of julienne fries okay that was a throwback to an old commercial in the 1970s but yeah it if it sounds too good to be true in this case i'll show you some of the use cases where we will employ that and do those things very quickly i myself have been challenged to take some of my scripts from business rules and script includes and when i put them into flow designer and i've been thoroughly amazed at the outcomes of those challenges in one case i had uh it was about a 300 line script include called from a couple of business rules and jason mckee my teammate said now can you do that in flow designer it'll make for a better demo not only did it make for a better demo but what took me about three hours to write in script and about an hour to debug took me less than an hour to implement in in flow designer including debug including one custom action okay that was a light bulb moment for me a couple of years ago i went wow okay that was the turning point where i said it's my go-to workflow process automation tool now okay uh it flow designer also makes more sense and for those of you that have used the legacy workflow tool you often find that you say hey here's my change process and it's monolithic it goes from start to end and it manages every state and every approval and every piece of that interaction for the life cycle of a change request okay try not to think of flow designer in that capacity think of it as discrete pieces in fact later in my uh as i was using workflow the legacy workflow i was breaking it down into smaller pieces saying you know this part's just going to handle the approval and they'll have a ui action to manage the state or something of that nature because it was very hard to build and debug and test and maintain big monolithic workflows think of workflow more like somewhere between think of flow designer somewhere between workflow and business rules okay business rules small little get in get out do a specific thing triggered on an action very much like flow designer workflow big monolithic handles end and hey hard to build hard to maintain flow designer easy to build easy to maintain easy to test and it works as a reusable component not going to show that to you today that's part of the flow api and i believe i did a video on that recently if not i will look in my reference and get that to you shortly but you can you reuse these components and there's a flow or is a sub flow or trigger an action very powerful stuff so think of them as little discrete pieces of logic i want to trigger an approval and if the approval is approved i take an action and it's done you may trigger that up that flow several times which is very nice again kind of like a subroutine so before i move on another question in a lot of people's minds is what happens to legacy workflow is it going away the answer is no we will continue to support it you can continue to build you can continue to maintain i strongly recommend building new workflows in flow designer any new logic you've got to add on build it in flow designer the two can cohabitate in fact you can call a legacy workflow from flow designer if you want to take advantage of that investment but anything new that you're building really think about building that out in flow designer for the speed and the testing and the reusability capabilities okay it will you'll you'll thank yourself later so if you're one of these legacy programmers are going wow i've got i've done everything in workflow up to date good for you keep that there we'll continue to support it it's not going away it's not getting any new investments we're not putting a whole lot of r d into it unless there's a severe bug that we go wow that was totally broken for the last six years we better fix that okay i think most of those have been shaken out because that product's been around for 12 years but flow designer is really where we're going to be investing a lot of the new capabilities so let me start by bringing up flow designer get the right pointing device that happens i'm dealing with two keyboards a trackpad and a mouse and four screens so it's a little a little messy on this end but hopefully you get you get this what is the execution order of flow designer if i'm running it in the background and how can i set the order uh flow designers execution order typically you wouldn't have multiple flows triggering on the same trigger okay if you are you might want to look at making sub flows so good question let's go to flow designer and let's create a new flow my use case for this is going to be i've got you've probably seen this on previous episodes i've got cls courses and i've got tasks underneath each one of those so let me go to the data model real quick again wrong pointer device go to employee cls and i have courses and each course has one or more related tasks to it okay so i can create a task under here and the task has an active flag and the task has a state okay much like you would see with change or incident i'm just using courses as a generic model now when a course is deactivated somebody says i want to take a parent record and mark it closed so let's take the cs210 course and say your state is now declined or inactive we'll change it to inactive when we turn off that active flag i want to take all active tasks under a record and deactivate them much like you would do if you were canceling a change request or a problem ticket or an incident or somebody checked out a laptop if you cancel that let's cancel everything else after that so we will go do that it's a pretty simple flow and again this is flow designer basics so i bring up flow designer and under paris it has moved it used to be a menu option called flow designer it is now under process automation because we also have some new capabilities under there that i'm not going to get into today but we have flow designer under process automation let's go to this menu over here on the far right and say i would like a new flow we'll get into subflows and actions and data streams later but a basic flow has two parts an action and a trigger we will give this a name close course tasks on active equals false okay assign it the scope just like any other artifact which are normally automatically assigned based on the scope you choose in studio or the application picker this one allows you to choose it as you're creating it protection is for my benefit as an author how do i want to make this available should i share it with somebody else i'm not going to worry about that a nice description would be good when the course closes eg active equals false then hit command space somehow then close all active child tasks okay i many of you are thinking i could do that at about five lines of script great but a poor administrator who doesn't know javascript years from now is going to look at this and go oh it's script let's make management and maintenance easier on these things i can run it as either the person who initiates this session so if chuck is sitting in front of the keyboard and happens to close a record this flow will run as me with any entitlements roles that i've been given or i could run it as a system user and say forget the acls blow through those and just do it if i choose that this other box appears or disappears so i could say look i know chuck may not have the right roles to do these record operations because maybe the task table requires a cls course admin and chuck doesn't normally have that i can go look up some of these roles x underscores 6 6 2 3 8 cls 3 2 3 and say all right there you need this role to do these operations because the table has those acls i can temporarily entitle somebody to that role this as far as i know i'm 95 sure about this but please check with your account team this does not count against your licensing there's no additional cost to give temporary entitlement i would not recommend going through and putting admin on everybody's role because you could run into security on everybody's flow because you could run into security issues this is a great way to say you know normally i would have to grant users this role and i'd be charged for that and they run this flow twice a year for you know quarter end or closeout or one of these infrequent tasks you don't have to do that now you can be a little more responsible with your licensing so i like this feature for now i'm going to keep it simple and just say run a system user i know i've got admin role on this thing anyway now we're brought to the flow designer canvas that message that popped up behind me says hooray you've created a flow good for you okay this is the name of my flow and i can change it at any time simply by clicking up here as i can do with actions and subflows i've got some properties that brings me back to my original properties should i want to change any of those and i start with the trigger when would i like this to start just like a business rule it has a trigger based on record was updated record was inserted well i've got a lot of choices here i could do some record operations i could also run this as a scheduled job every three hours every night at six am whatever it happens to be i could run it from inbound email service catalog tasks and watch for more appearing here in future releases so this is continuing to grow in my case i'm going to do it when a record is updated then much like business rules ui policies many other things i pick a record which will be my course table and i can add additional filters i don't want this to run for every update that would be inefficient and it would also be inaccurate i want it to run whenever active changes to false pretty simple stuff we've done this before again no scripting very easy to do can it be used for scheduled jobs also short answer on a palm yes that would be a trigger based on a date here very easy to do is there a way to bypass flow designer flows similar to set workflow false shane good question set workflow falls on a glide record disables business rules workflows and flows so be very careful with that you may be turning off more than you like same kind of thing when you run an import and have that checkbox that says run business rules that's doing a set workflow false it will turn off flows there may be times when you want to do that and then there are maybe times when you don't i also say when would i like to run this i could run it once one and done okay this is kind of that situation you're not going to close this thing every time i can run it for each unique change go check the docs on the wording on this i believe i've got this right but a unique change would be say setting the order from 100 to 200 then back to 100 is not a unique change okay it will it will do the 100 to 200 but when you change it back to 100 it goes been there done that we're not going to run the flow this time that's where you would want for every update so there are some subtle differences in when you run this and if you've got a process that's running say for two hours and you try to run it every hour this is a good time to say only if not currently running okay i only want to run this flow if it's not currently engaged maybe there's an approval that's been sitting out there waiting you don't want to fire off another approval okay that's good time to do that there are some other advanced options under here i don't want to go through those because this is flow designer basics i've got a basic trigger i'm going to run this because i'm going to test it a couple of times let's run it for every update just for this example normally this feels more like a run once thing spells out what it is course updated where active change equals false great stuff easy to read if you can't remember there's an annotation over here in the little speech box and you can say when active changes to false run this flow okay you do what you want to do it's pretty fun stuff i made a change so i would like to save save early save often that's the trigger that tells the system when it's time to engage also notice this is not active yet there it's greyed out here but i have a box that says activate it's not active yet i don't have anything to run now i pick actions and i've got three choices i can pick discrete actions that do something like update a record send an email log a message send a slack message that kind of thing i also have the ability to run some flow logic check a condition if this value is greater than 10 run a loop hey to see all those records i just did a lookup on let's go through each one with a for each loop let's make a decision let's branch and join and a lot a lot of stuff under here and sub flows which is like a flow but it's a small discrete component that i can call over and over in multiple flows i've gravitated towards doing more subflows i believe i just did an episode on that so look for that as well i'm kind of jumping all around in these topics and i'm trying to do a reset in my head to say let's start with the basics so this is one of those basics episodes so first action i wanted to do in my requirement when the course changes to inactive i want to go get all the child tasks how do we do that well there is a servicenow core action called lookup records this is effectively doing a glide record query for all you script heads and i tell it what table this is going to be on the task table but there are bazillion task tables so i'm going to say x66238 cls 323 to kind of narrow it down a little bit better and there is my community live stream task table i can set conditions so i don't get all of the records well if it's already closed i don't care so let's get the ones where active is true i can order it i don't necessarily need an order they're not coming back in any special order and the maximum results how many maximum could i take a thousand sounds good i hope i don't have a course with more than a thousand records that goes and fetches me all these records now sidebar literally is over here called the data panel it has been building things out when i set my trigger it gave me a course record because i said i need a course record it can also tell me what fields have changed under this data structure these are called data pills so i can easily very easily and quickly navigate through various attributes and records and data that is part of this process when i did my lookup records and i put my fat head away here so you can see that i've got a task record i've got it i know what table it was from and i know how many records were retrieved for me so the data panel will continue to grow and i will use that in future parts of my flow like now now once i've got all the records looked up let's go to the flow logic and say for each that says for each what well remember that list of task records i simply drag that over drop it there okay option two if i was wrong i click x option two is i use this icon called the data pill picker and i can navigate and this lines up with these major blocks over here on the data panel i've got the trigger record nope don't want that i gotta look up records yes i want that and i want the task records does the same thing when do i use each well if it's on the top level or one click down i'll usually use the data panel on the right if it's deeper than that then i use the data pill picker because i can type ahead and find that we had a nice discussion with jake berman who leads this product on live coding happy hour last friday he gave us some insights some really cool things that are coming so look for more ease of use things coming with data data pill picker and flow designer in general all right that's my for each loop now notice that it made a branch for every record that goes down here it's going to run whatever is in this little side branch kind of like indented if i put another action here it won't happen until the for each is done so for each what well for each task record and the data panel let me get out of the way again maybe i should just stay out of the way the data panel has put a task record underneath the for each so i can work on just that record okay let's take that and do an action so for every active record oh i missed part of the query shame on me it would have closed all active task records that would have been bad i need another condition on here and i say and course is course record yeah i better get the ones that are just related to this current course otherwise i would have closed them all bad me sometimes you find things like that in testing why did all my tasks close even worse is it looks good in tests you look at one record you go yup those closed then you get into production and people go why did you close my tasks they're not supposed to be so this is a better filter than what i just had doesn't impact what i've done below the flow because i didn't change any data pills let's do an update record and if you can't find what you're looking for in here just start typing it update record and i've got create or update well the task would already have been created so i don't need that update multiple records that might be fun what if i could use that instead of the four each hey let's try that normally i would have gone like this and put an update underneath the four each and i'll show you this plan i haven't tried the other way yet but it's an idea then i would take my task record drag it there it already figures out what table it's from i'm going to set the active field to true or to false just by leaving it unchecked and the state field we can put in as cancelled yay okay that's a pretty straightforward way to do it notice that the update task doesn't tell you a whole lot of details i strongly strongly urge you to add an annotation to your updates or inserts or whatever so set active equals false and state equals cancelled that helps you later to go wait a minute i've got 14 update task records what is doing what very helpful let's try this that's really it i've just finished my whole requirement and i was talking a lot are there ever situations where you need to save to refresh and update your data panel i've seen that in previous releases haven't seen it too much in paris yeah sometimes you go to pick something and it's grayed out well that's weird so i save sometimes it even requires a browser refresh again i haven't seen it too much in paris but paris has only been out for a few weeks and i've only built a couple of flows so we'll see how it goes there's my test my my flow is pretty much done i've got a lovely test button up here and i test it the test button skips the trigger so i don't have to change a course from active to inactive but what i do need to find is of course that has some tasks so let me go down here to tasks and it looks like flean has a few one two that'll work lean has some stuff so let's pick lean as our course i can optionally put in and say well yeah i i really changed the active state in case i'm using that in my logic later which i may i can change the active i can change the state i can set in those fields and say here's the field name here's what the value was impersonate that trigger in effect but i don't need that right now i've also got the ability to run this in the background if i were running say a rest api through integration hub that takes 15 minutes and trust me i've got something run that long i don't want to sit around and wait here and go is it working is it working i don't know i can't even check the logs because my one and only thread is being consumed by me so run it in the background and then i can keep an eye on the logs i can keep an eye on the records that are coming in going out recognize any problems and cancel it if i need to this one's pretty short and tight so i'm going to run this in the foreground i run it and i get this message up here the flow has been executed to view the flow details click here very useful stuff for debugging and testing your um your flows this is called the execution details and what you've got is here's the trigger and it assumes because this was a test it assumes that the trigger happened but even more interesting down here is the actions all right so i said go and look up records where active is true and the course is trigger course record and it said i returned zero okay you see that runtime value for count is zero that's not good okay we should be uh having two well maybe it's a data issue look i happened to pick ones that were already inactive oops okay or they already changed which one was it i may have run this test before let's turn this let's turn these both to active and not cancelled it's probably while i was building this out and testing it and make these work in progress make these active test with good data and test with broken data i did those in reverse order close this and just hit run test again that easy i don't have to put in break points and script debugger and all kinds of other things oh look here i can already tell i'm having a better day because right here it says one of two when i did the lookup records i've got a value of two awesome and it says here are the two records you had fleeing dna and fleeing overview sounds like the right ones and for each record i can see what was updated okay there's number one and if i click two i see well look right above my head right here you see the society changing when i go from record one to record two so you can step through that for loop find out exactly what it did when it did it how many times it did it where it may have run into problems very very useful stuff on the execution details so check that out chuck your tasks have been active equals faults before yes dirk you are absolutely correct that was the issue if you've got an async business rule on update and also a flow background for update what will run first i give up what i honestly don't know right now uh async is kind of a mystery black box obviously you can put an order on business rules be very careful don't assume what you think is going to run first will run first so i'm sure there's an order in there between which i know that flows run before inbound email action so if you're processing email in both or either flows will run first so that one i do know at least that's the way it was when it came out in new york orlando can't remember all right let's take another use case while we still have a few minutes left and my second use case is going to be more of a scheduled job use case scenario so every night i want to check for overdue approvals and send a notification let's say they've been sitting around for a week i think i did this on a similar episode recently about approval reminders but i'm going to do it again here just because it makes for a more complete use case oh almost forgot need to click activate this is sort of in a draft state it's not really going to run it's it's going to be on the drawing room board and you can test all you want but it's not going to run until you hit activate and that's what publishes the workflow to make the system recognize to run the trigger goes ah now i can pay attention i could deactivate it later if i make further changes i will need to save and activate that new version so we can do that there is a menu over on the side that allows me a few different things for configurations i won't get into those too deeply today but lots of lots of stuff to check out out here i just covered the basics let's get back to our other one of doing a nightly a nightly flow i could either go back to home and click new flow or if you notice when i'm in here there's a plus sign that pops up and i can do new flow there just a little easier way of saying hey i've got all my flows i've got 15 tabs open let's go create a new one let's call this approval reminders remind spell it reminders part of the cls app and and send a reminder for all approvals requested greater than seven days ago how's that it works for me let's run it a system because it is going across different approvals across different records it may need some information that it needs the trigger on this one is going to be daily and i can specify what time each day or i could say run it at a specific time okay run once run multiple there's lots of different things in here so i'll say every day at 8 am because that's when people come into the office and check their mail or if you're weird like me you check the mail before you really get to work um it's already got my trigger in here so i know what the run start time is that will change each time this is run and my action is going to be another lookup records so i don't remember where it was i'm just going to type up look up records the plural one not the singular one this is going to come out of the approver table which is sis approval underscore approver where state is requested and i look i'm typing this as fast as i can say it practically created is at or before um one week ago seven days ago let's just do last week okay you can get that figured out do i need any additional filters probably not if i wanted to i could order these by class or something clever do that there's my lovely look up just like before i didn't try the update multiples oh let's do that after we're done with this okay we'll do that as a stretch goal try the update multiple records this time i'm going to do a four each on the approval records and for each one i'm going to send an email okay not really much exciting stuff going on in here is there the target record will be the approval record and i can send this to this is where you need to be a little careful because for each approval record there's an approver but if i pick that the value in there is going to be a sys id so i need to drill through the approver to the user record and get the email address explicitly it doesn't do this like throwing somebody into the sender field or the res who's it going to when you when you're doing a notification you have to be explicit on the email learn that the hard way okay approval greater than seven days you can do that hey go approve something i'm going to keep this mail very simple and you can see what happens i'll save it and i'll test it run it in the background and i believe i have several old change requests on this instance that need updating it's running for a scary long time that's either really good or really bad let's go look how many did it get 316. wow that's annoying but now those people have email and if i go through the first one you see here's my subject here's the body here's who it went to luke wilson obviously i want to put some other details in there but i've got what i need out of this message and if i go to message record two three four okay all that stuff is changing accordingly i've got all those emails going out again i would want to activate that to make it run every day at 8 00 a.m very easy to do now back to our stretch goal since we have a couple of minutes left instead of a four each we did our look up let's take this out and if i take the four each out it's also going to take out any underlying actions so it's all gone let's try this because this is new in paris i haven't tried this yet update i thought it was just an action step but there's actually an action for it update multiple records on the um oh is it the task table oh bummer cls 323 ask all these conditions must be met you know what i'd like to read what that says so action update do you specify the condition update multiple records on a servicenow table you can configure the conditions for those records to be updated server-side validation rules are enforced data policy business rules dictionary defined mandatory field but ui policy does not apply okay so if you say a field is mandatory with a ui policy it's not going to bark at you here i may not need this this might just be a one action oh this would be really cool if this worked okay it was active is true and course is course record now i'm going to set the active field to false and the state yield to cancelled this could be a big time saver and the other thing i want to know is do i get any information out of those records i get a count behind my head again i get a count a status and an error message should something not work like data policy gets in the way okay order buy don't need it ordered by anything i really want to test this this is fun this is how we learn kids and if i look at other tasks in this list that are active let's go get something from de rey i don't know i made that word up and i don't even know how to pronounce it but let's test this on that one how many did it get on how many did it update before each gives you the visibility into that i don't know what this will show us it doesn't give you all the records it just says i updated two okay but i can't and theoretically they've been updated to false cancelled let's update that and they have how about that show matching shows me three i didn't say two oh because one was probably already closed yeah these two were closed this was sorry this was closed it was already false so i know my condition worked perfectly i had three records but only two met that condition all right that's a time saver not as clear for debugging on exactly what happened but update multiple wow that's awesome i like that action look how simple that flow has just become think about doing that in in a script you could probably get away with two maybe three lines of script and a business rule but still this is easier to see easier to test easier to debug and if you have to come along later and make changes well now your old flows that are still running with the old logic will continue to run that way can flow designer be used in place of data policy no not it's not its purpose data policy is like a ui policy for doing conditional form things but it does it on the server side so it enforces things like mandatory fields in fact a lot of times when you are going through i think it's guided application developer and you say this field is mandatory it's creating a data policy rather than a dictionary item so totally different use cases for those flow designers for processing the logic typically off of a data trigger great question by the way a record has been changed a record has been created a record has been uh deleted a scheduled time has come around an inbound action has happened data policies are reacting to changes on the form in real time as they happen so much like a ui policy it's the server equivalent of a ui policy using flow designer can i move data you incident slash change records from one instance to the other instance yes with the help of integration hub you would do that through either a rest api or if you're really interested in moving data between there look at potentially instance data replication very handy way to keep data in sync even based on very specific conditions so i only want my open actions sent to this other instance something like that i use it to keep my dev instance data up to date with prod data because uh every night every day something's happening in prod on certain tables not all tables because it's not not a replacement for cloning can you please show one example of an inbound action in flow designer i can get you started but i don't think we're gonna have time to do a whole one and i haven't thought about a use case for this yet but let's create a new flow process course email on this i'll skip the rest for now the trigger would look like inbound email and i can set the condition to say perhaps subject starts with course you may be getting email is the poorest of the poor man's integrations okay i'm gonna preface it with that now if it's a reply to record i could say watch for this watch for these and update records on this other table but for now i'm just going to create a new that's the difference between like the reply to in the new in an inbound email action if i do that then i could go ahead and create a record i could create or update a record create a record and notice the data pills i've got over here i've got access to a lot of stuff in my email record including cc and bcc and the state and the target table all kinds of wonderful information i can drill into the user that's referenced so it's going to do a lot of these lookups by itself it will not copy the attachments automatically inbound email action scripts do this implicitly we specifically detached that as an action so i would create the record and then another action would be i could get the email header case there was something in the header that i needed lots of actions around this stuff but i would also do look up email attachments and then i could tell it how to dispatch these i could attach them to the email or the the course record i could attach them to nothing i could throw them away so you could definitely uh do that it will ask you which email record i want to use that record easy to do stuff lots of email options but as opposed to inbound actions that do a lot of these things implicitly you may have to add these actions on because there may be times when you just want to receive an email and say ignore attachments i don't use those or if the attachment is important i could even perhaps start a an integration and process that as part of that action so very powerful things and again i've done inbound email action scripts they get kind of get a little loopy sometimes this is pretty straightforward uh when is the record when is it recommended to use flow instead of normal workflow now that's my recommendation use workflow if you're maintaining older things that were built in workflow but please don't start new things in the legacy workflow you're only limiting your options as you go forward you're going to hit some situations where it's not going to make sense or there's a capability that you don't have that you'll need and you may be choosing to make a custom activity in workflow at this point forward net new work should be done in flow designer when it involves something you would have normally done in workflow business rules schedule jobs so that's my recommendation for now let me just wrap up with again for people new to the platform flow designer makes it very easy to automate your workflow logic of your process for you veterans okay raising my hand high on that one retrain your muscle memory to stop writing scripted business rules legacy workflows scripted scheduled jobs that kind of thing email inbound email actions start writing them in flow and also for you veterans think of flows and sub flows as modular okay get in do your thing get out by writing an approval the approval handles just the approval piece it doesn't worry about what's happening later on in the process and downstream it's not monolithic like the legacy workflow doesn't go end to end on the life cycle of that record it's doing certain things at certain times and may even be run multiple times so it almost makes rollback kind of not important anymore that is all for today please join me on monday the 24th when i take one of your suggestions somebody sent this to me and it came up in a previous episode about approval summarizers that little section of the form that says hey you're approving here's what you're approving and how to display that i'll show you a couple tricks that uh may be new to you maybe not maybe you knew it maybe you've got a couple tricks to share with me but join me on monday the 24th for approval summarizers and i look forward to seeing you then until then where's the music that's it i'll see you later take care [Music] bye you
Info
Channel: ServiceNow - Now Community
Views: 8,162
Rating: 4.9432626 out of 5
Keywords:
Id: -gtjZ62ewwA
Channel Id: undefined
Length: 56min 11sec (3371 seconds)
Published: Thu Aug 20 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.