CLIP: ServiceNow GRC/IRM: Full Flow - Converting a Business Rule to Flow Designer Action in 10 mins
we get the indicator oh look wrapping the get good stuff so how will we convert this to an action first things first create a new action and this is called update last result passed grc profiles and our category is full flow as i mentioned on the previous stream and i've also anyone watching the channel um i've set up a playlist for grc full flow not sure when i'm going to be doing all of these sessions in in the back of my mind i'm like can we convert grc to flow designer in 24 hours so i'm wondering whether i need 24 individual one-hour streams and try and break it down like that so i'll set up a playlist i'll try and shed you ahead of time but i did it yesterday for a test run felt really good i think it's a pretty solid idea um and still just feel a little bit uh excited about it so i'm doing another one tonight we've got flow designer update last result passed so we have the indicator result is our input here we call this indicator this is a reference to indicator result we can't do anything without that that becomes our current okay when we look at that business rule that's the current record output did we really return we don't return the update i feel like we should probably return success or not well we're not doing it so if we convert we try and stick to a basis of like for like because if i start improving things or okay i might think it's an improvement if i start changing things that's going to complicate stuff so let's keep it there is no return so therefore there's no output so first thing here is a script step and this is going to be update last result passed variable is going to be indicator record and this is going to map to my input my code it's already available so indicator result equals so let's put in here i don't want to pollute the namespace by calling things current so i'm going to say well indicator result is i'll call it gr indicator result equals inputs dot indicator uh it's not an indicator record that's named wrong it's indicator result the problem is you've got a field on indicator result called past so this should actually be called that's a string of past and that is gr indicator result dot i prefer to use get value i know there is a lovely article on code creative io about stringing how to string variables in servicenow and i don't want to credit the wrong person let me check code creative io service now string get value king of string yeah travis wrote this one yeah travis tolson last march 2019 um so you know if you want to explore i'll just stick this in the chat for anyone if you want to explore when to use get value whether to use string in etc plus quote quote i think sometimes it's just flavor but you do need to know how it responds and how it handles things like null values okay i feel like i want a string of the past ah but you see down here he's testing it for true so that's probably why so again let's not change things so i try and stick to that mantra indicate a result i'll change my variable name indicator result so that's a glide record coming in i've indicated result table my string of past is coming from the past field on the indicator result then i'm going to look up the indicator and i'm going to change any reference to current here if we don't have any then return indicator see again i love to use set value i don't like this dot walking i feel like it's unpredictable sometimes you're dealing with glide elements um it's not for me it's not ideal so indicator dot last result passed equals string passed equals true if it's not equal to true then that's going to be set to false and it updates the indicator so i feel like that is all we need from an action we need an indicator result to go and just test this against indicators in fact if i go to my recent history i love using this clock that's what is there for your history if you were there recently use the clock here's my indicator manual test now you can see here last result passed so what i actually need to do is on this one and i need to be in the app i believe in the right scope if i look here last result passed if i set this to false okay okay that's false now this indicator result passed true so if i test this flow designer how can i get the display name of this result generated from phil entity doesn't really matter which one of these it is if i get this in here either one of these run test it was completed and we've got a green let's go back that result passed okay so my actions working i'm happy that my action is working update last result passed that name is a little bit too generic now for an action here let's say update indicator last result passed save that publish the action okay now i'm going to create the flow that matches my business rule just close explore and go to this one this business rule when to run
https://www.youtube.com/watch?v=TQkEXbMolyE