NOWCommunity Live Stream - Lessons Learned - Flow Designer - Referencing Records

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[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 from ServiceNow and I am here to bring you the answers behind the answers in the community this is the community live stream and if I can get my screen on the right screen here we go this is this is to bring you the answers behind the answers the thought process the journey of discovery everything that goes into the things that I see and learn and want to share on our community are out there so you can take those techniques that that behind-the-scenes thinking that critical thinking of why should I do this how should I do this what's the best approach that kind of thing take those to your job and become a more effective ServiceNow administrator and developer thank you for joining me today we do this show and you have asked for this why didn't that go there we go you have asked for this you have asked for scheduled for a while I know you have because some of you have asked me are you gonna do this on a regular schedule it was fairly random before and I'm going to do my best to bring this to you on Mondays and Wednesdays excuse me will Mondays and Thursdays that just came out wrong for whatever reason Mondays and Thursdays at 2:00 p.m. UTC that's my goal I had to make a slight adjustment on this one the first one out of the gate on the schedule was off but as soon as I scheduled this for 7:00 a.m. my time someone put something on my calendar and blew out of the water so I will be adaptable as necessary so while I'm home well I'm healthy while I'm doing these things I will do my best to bring this to you Mondays and Thursdays and these are going to be topical remember I have changed things up this week I am going to be as you saw from the title going into a lessons learned I've broken these up into subtopics if you will still the community live stream subscribe to it on youtube there's the URL turn on those notifications so you get those wonderful beeps and bings and things like that that look like see if I can get this yes there too and also do this on Twitch so if you're watching on Twitch you can get that notification why that one hasn't come in yet I don't know I'll look into that but you can always use that as a plan-b get that out of the way I'll see you there so as far as the sub brands on this I want to keep matching this for a little while longer until we get this all squared away I am doing lessons learned is this one so these are things that I've learned along the way kind of learn the hard way skinned my knees took a long time or or had to ask a subject matter expert or subject matter expert imparted to me and went wow that's awesome everybody should know about that I want to share that with you that's today that's the blue theme lessons learned don't ask me why I picked what colors I did last week we did a code decoded topic which was about scripting in api's if there's an API specific one whether it's a REST API or scripting API we'll dig in deeper on API adventures and then if it's a general going into the community and saying that's a great idea I like that that would make a good discussion topic or I want to explain the reason why behind it pick this reason this answer that would be behind the answers you'll get the idea as time goes on then if we'd go in deep into something it'll be a topical deep dive sure there's our viewing points of which one goes in which one it could be an API adventure or it could be a code decoded or it could be a technical deep dive doesn't matter what it's just a whole lot more fun and it will be more prescriptive so if you're looking for that episode on glide aggregate or whatever it happens to be you'll be able to remember the color mnemonic it's in the title it's in the description it's more specific than this random hodgepodge of things that comes out of the community with the exception of behind the answers I want to bring you one of those once in a while because it kind of goes back to our origins on that alright remember if you have something if you like something in this video go ahead and click like would be very much appreciated for that also want to forget to mention twitch.tv slash now community knowledge is just a couple of weeks away so be sure to go and register for the free digital conference that we've got coming up looking forward to that we've a lot of stuff coming it's so freaking cool there's it's going to be totally different experience I have an article that's going to go on the developer blog which looks like this very shortly what we call it a know before you go in the past we've recommended bring a laptop wear comfy shoes but because you know you're already at home most likely you've got those bases covered so I'm gonna share a couple of other tips and tricks that you may want to know to make this a more effective experience and of more fun experience if you will watch for that article I'll let you know when that's up there on developer.com I believe there it is I do have a title for that still just don't have it hooked up to one of the new hotkeys still doing some tweaking with the new format see how the keys can roll and if we do any JavaScript today go and look if you're interested in learning JavaScript your admin who wants to become a developer or you a new developer or you're at a pre-existing developer that's worked in other languages that want to get into ServiceNow I highly recommend this series at the link you see there bitly - to learn - Jas excuse me I said learn Jas and you can go all the way from basic syntax to script and rest api's very very cool stuff so take a look at that and I think with that we don't have a technology so I can't Oh developer meetups yes under connect let's go back to the full screen where is it where is it I still get my buttons down here go back to the full screen and on the developer site developer dots there was no comm there are events and if you look closely there are developer meetups Bay Area is on the 28th that is a week away from today xx as I record this it's April 20th then don't forget we've got our Creator convert well hackathon get together with teams this is part of crater con but it's before.look May 1st through May 3rd you've got the weekend to build out your apps rather than just that 8 hour stint if you don't want to sleep that weekend great do this if you want to take turns and we got people around the globe maybe you forget somebody the US and you've got somebody in Singapore you got somebody the UK you could be doing this 24/7 think about that for your team that you didn't have to think about before and then other meetups coming up tonight on May 9th Boston May 25th go over to our developer site get those mute ups get together with like-minded people and have a grand old time I think let's let me look still working through some of the new agenda hang on with me yes yes yes yes yes okay let's get into today's topic on the community I want to talk to you about flow designer one of the first things that I learned about flow designer in fact I'm going to be using my personal developer instance that I got from developer dot service now calm before we jump into this I want to give a huge shout out to everybody who's joined me live here today thank you John Carolyn oh my goodness we've got a whole bunch of the regulars here why is my scroll windows not scrolling Chase is here now samyak Dhruv we've got a lot of regulars showing up yawn hello and thank you for joining me this morning this is the community livestream and we often have great discussions and comments two-way conversations in here we've got some people that are new thank you for joining me we've got some veterans like Jays who's been around actually I've learned Jayce has hate longer longer resume on service now than I do he goes back I think it was pre graphical workflow pretty legacy workflow so I was listening I think it was was Jace and Andrew we're having a discussion on the YouTube channel on Andrews YouTube about that good stuff a lot of fun wearing John okay so back to flow designer one of the first things that I learned is that well I want to I would make sure you understand that flow designer you don't think of it as a replacement for the legacy work flow legacy workflow when people would do that and if you're not familiar with this let me show you what that looked like workflow workflow workflow it's down here in workflow a workflow editor and very handy for its time wonderful tool came out about 2008 I'm going to back that font off just a little bit and UI has changed since first started but it looks a lot like the let's just pick one of these um like it rolled Superman on call time approval let's do one pass won't change master why not and it brings out this canvas I could have moved that Mike just out of the way you may or may not have seen this before I suspect you have but it starts with a begin you identify from the properties when this workflow is triggered and it will do things like run a script run another workflow run a script do a choice have a switch various outputs and it looks like this very handy people found it very easy to use especially if you were used to something like Visio great tool however it had limitations specifically you couldn't allow non advence to be building this stuff when we came out with scoped apps and delegated development it became apparent to us that this was a bit of a hindrance and we found most workflows had some sort of scripting components in here you can see there's a run script there there's a run script there there's a run script tip I picked this one at random and look how many it's got ok no coders are generally not going to run script and we want to enable the know coders in our enterprise so that they can be doing a lot of this basic work and then the developers can go on and do the more complex work so that's yeah definitely Jase this is way better than execution plans I had a small taste of those enough ok they came back made a resurgence when we had ServiceNow Express fortunately that's gone they still exist I mean I rarely does anything disappear from the platform that you can't use it if you want to look into execution plans and go play with them they're kind of a really simple way of doing some of this okay so this was a great step forward but we recognize that it was getting a little long in the tooth to harden a phrase then about 2017-2018 or leave 2018 we came with the release of Kingston Kingston London Madrid New York Orlando a couple years ago we came out with flow designer and I'll admit he of early releases it was limited now don't think of that as a direct replacement for the graphical workflow engine because most workflows that you see most I'm not gonna say all most workflows you see on the legacy workflow were monolithic change processes that went every which way think of flow designer more as a replacement for scheduled jobs and business rules inbound actions there are more types of triggers that you can use to do those and more will be coming out in the future I'm sure I don't know exactly what they are at this point but they will be coming out so think of it as SuperDuper hopped up steroid business rules a while back no take another step back into the time machine business rules under system definition we're scriptable only okay so when you created a new business rule it would look like this okay you'd have this advanced page you'd have a couple of window runs insert it wasn't even a tab form way back when but all you had was this script box and it didn't even have that it looked like that it was like unprotected kind of crazy what we did in I think it was 2012 or 2013 it came up with the ability to make script list business rules codeless business rules so you could say I don't necessarily need advanced the Advanced tab goes away when you want it to run I want to run when let's just pick my employee table from my CLS app Dada and it says what fields are on there let's say when the state changes to something very easy to do you can do this instead of going into advanced and trying to figure out what this condition should be current dot state changes to what was the number was it a number I don't know okay so a lot easier to do that to build these types of conditions and then the actions were available to do set values at a message or abort if this condition was true I do this sometimes to validate dates if you want to make sure a date is not in the past you add a condition that says start date before after before whatever you want to do today nobody can enter a date in the past but a port action dates can't be in the past okay great simple little use case for a business rule but they are single trigger single action okay you can argue that yeah I can script more actions and they're fine do that have fun but business rules were not the end-all be-all flow designer takes that one step further and I'm going to do this employee trigger test that I was playing around with before I want to take a couple things out because I want to show you what happens let's delete that you start with a trigger much like a business rule but the trigger can be a number of things it can be when a record is updated or created or updated or created do both the you can do it on date so look at scheduled jobs scheduled jobs today or previously scheduled jobs were only scriptable I came up with a little shim about a year before flow designer came out to help people write script lists business script las' schedule jobs you can still find it you can still install it I don't recommend it I wrote it but I don't recommend it this is a much easier way to do that and a much more powerful way to do that so look at using this I just brought some of the technologies that made business rules codeless and put them onto a schedule job not a major thing at least I didn't think it was but don't use that anymore go here if you want to do something daily weekly monthly whatever these are the options you had for scheduled jobs you can still write custom actions and filters and whatnot so and then of course there's service catalog you can attach these to a Service Catalog item instead of a legacy workflow you can do inbound email Wow much easier than writing script only in those inbound email actions and manage the attachments and great stuff get the fields and forms and I love this inbound email is probably the most powerful things my next secret wish is I want to be able to trigger a flow off of an inbound API of some type say Oh someone hit a table run a flow someone delete someone hit a script script arrest API trigger a flow yes you can do that with the flow API script but I'm not gonna get into that okay so let's look at what I did I said take my employee record and what if the title starts with senior SR then I'm going to run only if not currently running and that's my flow trigger it's only going to do that so if I say do I now have a series of things that I can pick under this actions actions I've got some that are core I call those out of the out of the box we can do other actions in here including some Global's and you can make your own actions with the action designer for example if you wanted to find out if something was the beginning of first Monday of the month yep go you you write your little script to do that then you hand it off and now no coders can take these things and drag and drop them I'm going to simply log this is a great way the debug shows up in the system log shows up in the flow designer what do I want to log well I've got these data pills over on the side this is my data panel over on the right-hand side that shows me all this wonderful data and I can drill into these and if it's a reference field I can go even further drilling into those employee table is a very simple table there is no great magic in here but let's just say name starts with senior ok I'm just going to dump out a log I can put in the data pill I just drag that out I'll show you another way to navigate to those in just a second and save now here's the fun part I can test this flow without activating the trigger so Jay says does that run only one time ever or one time per record updated assume the record update so this will be what he's talking about the trigger this trigger if I did not have this I have a choice of running the trigger once and only once once it's done it's done and you may want this in certain cases if it comes to approvals you can have it trigger over and over again for example I could do run this flow for each unique change as long as the trigger matches and the condition matches just like a business rule or anything else that has a condition on it says alright you have to meet all these criteria condition is included if I took this condition out it would run for every update if I said for every update I could do that every maybe that's handy if you're going to calculate you know total based on some related records go look up all my child records and put the total back here great way to do that you want it to run every time okay you could also say only run it if it's not already running case for that might be an approval if I've got an approval that's pending and something goes to trigger that flow again I say whoa stop stop stop stop don't trigger that flow again because I've got an approval in progress already wouldn't make sense to get two or three or four of those lined up and know which one is in control so you can control which flow is running at any one time hope that clears things up there's also for each unique change I haven't used that one yet I can't even think of a use case for it but if I do or somebody else does please put it in the comments below on the community or in the YouTube video so I'm going to put only if not currently running you know No I'm going to put for each unique change that way it will run what I wanted to run it's not like this thing's gonna be stay running forever actually I will have a wait for so I'm gonna put only if not currently running going to do a wait for in here I want to see what happens okay that's a little bit more about the trigger great question thank you I've got my log statement in there I'm going to save that cuz I think I may have saved something but I'm not going to activate it yet this one already is active somewhere running there's activate and then there's test okay think of it as if you're used to the old workflow there was published and then there was direct kind of working in this draft mode that's what I'm working in right now there's already an active version out there that's watching for records it's this one is not public yet so I'm going to test my change on an employee record I've got me and I've got Craig and I can simulate added field change now this says hey how's chucks it's going to skip the trigger the test always skips the trigger so let me find my employee table make sure that I am satisfactorily set up with test data come on I clicked it there it is and what is my title my title is senior developer evangelist let's go back to this and say today for the moment I'm only a developer evangelist save that I run the test and all it's going to do is say does the title start with senior but it skips the title so I'm hitting the actions right away and what I should see is trigger skipped log run when I click the log line it shows me these are the execution details some people call an operational view I think that's what we called it originally I learned from our documentation team this is the execution details you could also find this over here on executions I went up to the Home tab don't have my little cursor things on at the moment sorry it's not go to the home up here on the far upper left click executions and it's sort of like saying show me all of the workflows that have run and I've got one at 851 which is about now and I can see the same thing because it's already open out of town okay I clicked a log line says it was completed and I could see the details in there what did I configure it as don't know if I can highlight you know what I want my my little green and circley things so I can point you in the right direction on this screen so let's go here oh look at that legacy picture I want my mouse locator I hope the mouse locator wants to play because I didn't know as updates since then I could not load mouse click oh I've got to do an update on it okay well mouse locators over here in the center I can see what my configuration was there's my data pill and there the text that I put in here and I can see the runtime value over here on the right it says Chuck Tomas he starts with senior it doesn't because I skipped the trigger if I were going to run this live I would do that so let's go back close out of the execution details and notice something it picked up the employee record now I would like to add an action here called ask for approval this is a simple way to do an approval I like this better than the old flow designer actually but the old legacy workflow pardon I said the wrong thing I drag a record here I want to do an approval on the employee record okay it's not a task based table so it's not going to have an approval field in the journal field and as a result I can't put the approvals related list on the form related list configure related lists and notice that there's no approval but I can still put an approval on there even we're tasks it's got some special attachments made to it another advantage of getting tasks so let's take that and say approve or reject when anyone approves or rejects tada and now I define who that anyone is I could put in live data from the data panel if it were a reference field I could put in a person I could put in a group let's add a user I'm just gonna hard code this cuz I don't have any data in that record that would help me and let's say Abraham Lincoln is going to approve this click done and I get my approval now I put in a condition notice that the data panel has also added another action action number two over here on the left is action number two over here on the right and I have a new data pill it's the output of that approval so I want to check if the approval state I drag and drop my general habit is drag-n-drop if it's right there you know level or two if I have to drill in then I go like this I start doing the data panel thing go into these various fields no no no no no it's a lot faster because I can also start typing like current and say current value current display value and it'll filtered out very handy because task has a lot of fields in it I'm looking for a work start I don't want to be scrolling I just start typing work boom there it is so you can navigate through the data pill picker or you can navigate through the data panel or you can put in other field values so the approval state is approved I get a little branch on my if statement now watch this let's I'm gonna go back to my employer record and see if there's anything in here let's add something in here so we can see some changes I'm making this up as I go didn't really think this through entirely but I'm going to add a don't think I have additional comments that I can add but I can add the activities let's just add a string field okay let's go to field types string and a string let's make it a bigger string so I can put in a new section this is form designer very easy to drag-and-drop if you haven't seen this I highly recommend it there's only a couple things that I don't use it for and that is dot walking and some annotations Oh an embedded lists the but other than that it's way faster let's put notes will call this notes field a big string maximum value is four thousand so it shows up nice and bacon text and wide and abracadabra without any HTML CSS or JavaScript I have a new big notes field on here so that I can do something with this so once it's approved let's go in and do action you scroll that up down here is update record I'm still in service now core there's a lot of really basic core stuff in there that you can and I am going to update the employee record this is really tough drag-and-drop ok flow designer fun I can I can write this stuff about as fast as I can say it let's set the notes field oh you know what I ended that field after I did this so I've need to save it didn't pick up the new data schema the new table for that so I'm going to back out and go back to flow designer because it needs to reread all that stuff at load I changed it it didn't pick that up that was my fault I should have prepared better now if I go back to employ and update employee record I should have notes there it is I can put in some notes this was approved I can use some data pills whatever I want now here's the tricky part let's let's also put in nine else flow logic else else was not there if else is if if if if is not there you get no else otherwise I've got the ability to put in else ifs and a bunch other things but notice below and else I can't put another else it's smart enough to know where you are and what you're allowed to do so if it was not approved let's put in a another update record grab the employee record same employee record notice where I'm pulling this from I can't pull it from this one because this employee record is down the other branch it's grayed out because this branch can't get something from another branch that doesn't make any sense but I can get it from trigger record my original bring it in talk to me this is what I had got to trigger the record notes says this was not approved okay I could have done this as a journal field I recognize that don't beat me up okay so if it's a I ask for an approval if I get an approval I update it put a note in there that's pretty much it so let's save that going to test it again and let's test my record boom boom go to the execution details and it's waiting says hey I fired off this is a case where I would want to have only if not running on my trigger I should probably change that trigger before I forget right because I only if not currently running hey I already did it thank you former smarter self now back on my employee record let's go to sis approval approver yes I know that's a crazy table name it took me a long time to figure out what it was but that table also available if you want you can go to my approvals and take out the filter and it will show them all from created Z to a and there is Abraham Lincoln waiting to approve I'm going to say hey go approve whatever it was and it says you can't do that cuz you have an approval thing yet it approved anyway so the test record should now say let's reload that it evaluated it completed and it should have written this was approved into the notes field this is really handy for debugging flows by the way the execution details let's go back to my employee record and there's my notes hooray it worked that's great we are able to update a record now what I want to point out and this is the entire point of today's session is I now have an employee record here in the trigger I have an employee record here in 3.1 update I have an employee record here in 4.1 update if I were to say add a notification send a slack message do something else where I need that record be sure you're using the right record let me put in a log statement okay here is log and I am going to put in notes is and if I were to mistakenly grab the notes from the trigger record when it's approved let's save that let's remove the notes from here get my demo data back to where it should be go back into flow designer good good timing it just saved I am now effectively using old data unlike the legacy workflow where you had a current object you could just keep borrowing from current and it was always up to date that may not necessarily be the case you may have a data pill on the data panel that has the updated information you may have to go look up records or look up a record to get that newer more more up-to-date information so keep that in mind that you've got sort of these stop points along the way as data is changing in the data panel very important to remember that caught me off guard a few times because I was still in that mentality of oh I've got the record the record is the record and it's always up to date not necessarily so close that and test this and say let's go to chuck run this it's going to get another approval says hey I'm waiting for your approval and when I go to the approvals there's another one for Abraham Lincoln approve I don't know why I'm getting that right permission I think I needed to cross API thing going on refresh that refresh that it might take a second let's go back to my employee record because I know it's updated there this says this was approved back on our operational details it is completed now what's in the log statement the log statement has the old notes there were no notes on the trigger record you saw me delete them but yet I put notes into the update record so be sure you're using the right one this can catch you off-guard because get rid of that that's an old one cancel that that's an old one get rid of that the correct way to do this in this one just I was making a point would be to go get the notes out of the trigger record let's do it this way agnus me not the trigger record we want to get the update record notice that 4.1 is anyone on this list I'm not that far in the flow and I couldn't do it cuz it's down another branch so update record drill into the employee record don't just get the employee record drill into it with this little arrow then get the notes now I have the up-to-date no it's okay so just when you think always saying okay I am going to show you something I have a I may be able to recreate this I'm not sure exactly what was going on I am going to take out this log statement and put it in a wait for actually no I'm going to put in a log statement yes let's put the log save it back in that was kind of silly of me log and title equals let's go get the employees title doo doo doo done save I'm gonna activate this one just to show something activate that it goes live so when I change my title we should see something happen we'll go into the executions and view that so executions it's not currently running let's go in here this is I'm gonna try and reproduce something that made my head go okay that I want you to keep track of if I can't reproduce it I apologize and I'll point it out my title I just got a promotion I am now senior developer evangelist remember my trigger on that flow is waiting for title starts with senior if it doesn't it won't run well I'm going to trigger it save that and go back to my executions do refresh the list and refresh the list and waiting okay it got through it triggered that flow I don't know at that cute statement but it takes a second or two for everybody you get happy on this thing these asynchronous this says in the log title is senior developer evangelist that was interesting okay now trying to remember how I recreated this before because that's the trigger record however I do have the field changes up here I can see what's running whenever any where's the changes information I'm not seeing it but I've got this approval that's already running calling source there's my original record open current record no where are the run trigger run flow in run Windows changed fields array not object here there shows you what's changed so the first thing that was changed is that value to this value what that means is I can get the previous values off of the trigger record in this changed fields I can find out what was changed and how it went pretty cool it's like having a changes from and it changes to and that kind of stuff even flow something we didn't have a couple of releases ago people were going well how do I know what it changed to I've got to go look up the old record in never mind so let's see if I can reproduce what was confusing me before tonight all starts with senior I logged that but let's say before I log I do a wait not wait for a duration of time I want action I always get those two mixed up there's two different weights there's weight for condition and in this weight for condition I'm going to take the employee record is going to wait for title ends with three exclamation points because who doesn't then I'm going to do the log so I've got trigger wait for log remember log is still logging the title of the original employee record the trigger record go back there save that activate that okay that I know it's not gonna run because it's only running once I need to go and do the approval to kick this one I should just get rid of the approval make this run faster but that's okay let's approve that give it a minute to settle out go back to my employee record for a minute okay do we where's my executions that one's complete good everybody happy I did not forget to kill that other flow because it's only going to run if no other flow is running so I do an update it doesn't care what update was made I didn't say the title has to change I can update this and trigger it because the title starts with senior did I or did I not delete that save that and let's check our executions there's one cute cute cute wait wait wait take a drink sorry - what's the difference mean work flow and flow designer I explained that in great gory detail a few minutes ago sorry you missed it but I recommend you go back and watch and rewind yeah let's check this out we have a wait for condition it's waiting for the employer record to end with exclamation point okay I have not logged anything out yet when the condition happens that allows it to move past this point okay and I say bang bang bang cuz that's what UNIX people call exclamation points because it's faster to say then this will proceed this will proceed down to the approval now get this I modified that record okay that was not the trigger record in effect I have the trigger record and now I've modified it and look what it says for my trigger employee record you can see that and see if I can zoom that in on you Oh Magic Mouse you're letting me down but let me go like this see what it says trigger record employee title in effect I no longer have access to my original trigger record why is that well the understanding I got is because it's done by reference I haven't accessed it yet now here's the catch I said wait a minute so if I put something else that accesses that trigger record before this wait for before it's changed I should have access to both and have to go to a lookup this is the part that I'm not sure it's going to work or not but let's find out let's put another log in here original title is now okay let's finish the approval let's get our data back oops sorry wrong screen let's finish out that flow so it can finish well we're doing something else approve you know what I'm just gonna take the approval all out of there before I put in that first long statement goodbye approval goodbye if statement so I've got this down to trigger wait for log and I go to action log before the wait for okay original title equals now let's put in employee record title there it is done and in this one I will put in new title equals before I do that let's go back to my demo data take out that to trigger the record take out that to trigger the you wait for save it save it activate the flow here we go this is the part that I'm not sure what will happen or how it will happen but it happened and it confused me I've got my data let's go to look at the executions no executions currently running so I'm going to say Chuck is now a senior developer evangelist save that flow should trigger and check to that it's cute check that wait another second or two waiting there we go it's in that wait for condition go to the execution details and the first log statement says your title is senior developer evangelist okay now I'm waiting for it to end with three exclamation points there right there let's go do that bang bang and save and I should have wait for it that's the flow that's the trigger complete alright so the first one said your title is senior developer evangelist second one says your title is now but it's still accessing the employee record if I wanted to get the original title I no longer have access to that it confuses me because normally you would have to go and say hey it changed I still have my original trigger record that was senior developer evangelist no exclamation points once I'm past this wait for that seems to be gone now I was told that if I reference it if I access it before the wait for it should work then work the way I was told so keep an eye on that because you may actually lose touch with that original record what do you do you'd have to do an operation that gets the record and then you could hold that in place so if I wanted that original record and it's it's long gone by this point I could put it in something as weird as this lookup record one record I don't need all of them and I'm going to select the table table is going to be my employee record this just seems totally bizarre to me but let's get the one and only record that has that sis ID so I puts this ID is there's my condition I don't need to worry about the order or return only the first record there should only be one record with that condition okay now I have that record and it will be available to me here so if I want the original record let's go reset our demo data okay boom that we're not playing that anymore save I could add to this log old title the equals something we're putting the data pill for our original lookup record employee title feels odd that I got to go retrieve it when I should have had it as the original title record did have a space in there I don't know no I don't want to all match together here we'll put a pipe symbol in or something make it look pretty okay log statements aren't supposed to be pretty save activate we're on unshredded ground here I don't know what's gonna happen Rolf had a comment I missed it looking through the comments okay title started with senior trigger the flow save that go back to executions will kill that old one check out the new one waiting here it is in the waiting for condition so this log said the original title was just senior because I saved it now I know that from the changed fields I could always go and get that field value because the previous value was just developer evangelist the real question is once I put on the exclamation points and get it past that waiting for save that go here to the executions I don't know why I closed that should be complete what does this log statement say says the original title the old title has exclamations the new title has exclamations what's up with that and how do I get my original trigger record back that's what I want to know what was the original data aside from having to dig into the previous value fields which I know I could do seems a little weird that we've we're monitoring we're not even changing this through the flow once I do that yeah then all bets are off okay let's let's go ahead and do that just to validate that will do an update record why not cuz that might happen update record on the employee record and I'm going to change the title to confused there that's totally appropriate this one however needs to get the latest employee record from Step four so new title should not be that new title should be update record employee title see how this can get really interesting if you've got trigger records and update records and other things flying around that would be interesting because you may not get the data you want when you doubt go look it up and you'll have the latest let's go back to beginning belapur evangelist that should not I say should very loosely a trigger the execution just wait a second just wait a second it didn't match my condition so everything is still good when starts with senior I save that triggers their record and there it is queued waiting waiting waiting take another drink there we go now it's running it's waiting for the title we already know that this is going to have senior developer evangelist in there we also know that when I put three exclamation points it's going to get me past the waiting for condition in a second or two click that it's still waiting for the condition like that now it's complete okay I did a waiting for condition and it's waiting for this says ends with that it did end with that now this comes by and says hold on update the record because title is now confused and in this log statement now I still have the one with the senior and the exclamation points it's not the original thing to trigger the record but I have the latest this as confused too so I'm not sure how I can get back to that original trigger record with senior no exclamation points I even did a lookup beforehand at that that didn't seem right because look before I even used it it was it was already I'm gonna call it corrupt so very interesting characteristics about using record references in flow designer bottom line make sure you're using the latest and greatest of any updated record that you can don't always assume the trigger record is going to have what do you what you expect because it may not it may have seen your developer evangelist it might have confused because there was an update made along the way that was the underlying message hope you got it I am going to sign out on this one thank you very much for watching everybody's been terrific great discussion going on in the live chat and with no other comments or suggestions I will talk to you again real soon see you Thursday hi [Music]
Info
Channel: ServiceNow - Now Community
Views: 3,062
Rating: 5 out of 5
Keywords:
Id: Jlu4DkjEB0Q
Channel Id: undefined
Length: 51min 32sec (3092 seconds)
Published: Mon Apr 20 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.