logo

NJP

#11 Approval with Flow Designer in ServiceNow | Learn Application Development | LMS

Import · Nov 10, 2020 · video

[Music] please subscribe to my channel and click on the bell icon to get the regular updates of my channel and do not forget to like comment and share the next feature we have is automate update of field values so let's say customer ask you that hey i want to automatically update the field values like that status and approval as well that means if somebody approves it it should automatically change the status approval status to approved as well and it should also show as requested that yes somebody has requested for the leave that's what i want and that let's say you get the requirement from a customer now how can i how how exactly you can fulfill this requirement so you we will fulfill this requirement with the help of flow designer so let's do one thing let's go to our instance over here and we will go to flow designer so i will create a flow designer basically i will create a flow so that i can show you that how you can achieve this without scripting so we just have to update the values so whenever record will be created the leave request will be submitted i have to update the status to submit it and i have to make the approval status to request it so we have we got the flow i will click over here i will click on flow so i will do uh maybe lms lms workflow or maybe i will just do lms flow here we have application and it says user who initiates the session that's fine and i will just click on submit so i'm going to create the flow and now i will create the actions but before that i will also mention the trigger point so i will mention over here and i will select the trigger i will make it little bit small and i can just select it says create it so whenever i will create the new racket i will basically process basically initiate this flow so i will select leave request and that's it i don't have to uh put any kind of condition maybe if if you want you can still put the condition that means duration should be there so if i come over here uh and if i have duration so duration should not be empty is not empty that's basically i would say kind of mandatory to trigger this flow so duration is not empty and that's it so let's just do like this and now i will create some actions so uh starting with first action so what we will do uh we have to basically update the racket so we will i will i will go to update uh if i have here uh yes create or update the racket i will do update the racket and i think here creator update create task create i don't have specific to uh yes i do have update the rackets as well yes so i will select update the racket um now which record i have to select i will just select this one same one which we are basically from which we are triggering the flow and what exactly i have to update so whenever we will submit the request basically status would become i will select the choice here submitted and at the same time i will also make the approval status to request it and that said it will basically update the racket and if we will match the condition then only uh it will basically update the racket in the bucket but as of now i'm just updating these two fields were requested and submitted as of now it is not approved yet how exactly i will send the approval i will go over here now i will ask for approval so here we have another action for which racket same racket this one i will select the approval field approval field i can select this one that's what the approval field we have uh now how exactly we will approve it when exactly uh so anyone approves it that's fine and i can select the approver now i can select any any one like it's it's up to um up to your business i would say use case you get from your customers so maybe i will select over here um i do have yes i have requested buy and i will send it to the manager so do i have manager yes i have manager over here and uh yep so it will send it to the manager so manager has to approve it and i can just maybe make it or if i do that anyone approves it and if it's approved so let's say it gets approved so let's say if i maybe i will just do um okay i will make it uh or maybe i have to change something over here as well uh approval it says i think this is something we don't have to select right now approve okay so it will approve automatically when we have anyone's uh approves it so in that case if it's gets approved so can i can i get something over here uh can i get it from here approval state okay so if the approval state is approved so if it is approved that means if somebody will approve it so i will update the record i will update the record over here so if somebody approves it it says target record which is this one and i will update the racket basically i will update the approval field and i will make it approved so if somebody is approving it i will make it approved and then if i'm basically approving it so it will automatically update the racket by approval basically the status approval status we have that this approval field uh this will become approved automatically with the help of this flow designer and i can also mention if uh maybe else if it is not approved or maybe we should do else if rather than else i will cancel this one and i will put or maybe i will just else if and here i see ask for approval approval state and approval state is let's say rejected if somebody is rejecting it and i will make it done and i will just update the racket with rejected and i will and this will not basically update the bucket because it is rejected so it should not update the bucket as well and here i will select this one and i will basically select the approval field here and i will update it to reject it and i will make it done that's it and i'm going to save this so it will update the rackets with approval and rejection and i will also activate this so yes i will activate this you can also do testing so when you create the flows you can also perform the testing but we will do the live testing so it is created it is activated as well what i will do i will come over here again now this time i will i have this not yet requested i have this open i don't have duration so i will select it maybe i will select maybe this one now you can still add more validation just to add another point that people might select the same field uh sorry same dates which they have already selected so that check you can also do that hey this for this particular date you have already applied for the leaves so i'm not going to add those validations because you can put to make this end-to-end application you can you have to put multiple validations so i don't want to uh put all the validations because my aim is to just to um i think basically make you understand that how we can do development for an application with different elements we have of scripting so here we will select this maybe uh 12th of october till uh 15. so we have got four days over here so it's 12 13 14 15 4 days and i will just mention just a random comment um i'm not selecting these fields this time i will just save this it is saved now you will see that it is not basically it has not changed okay it has now so i think flow designer runs a little bit slow so i think it's kind of surprising for me that why it ran uh slow but that's okay it basically updated the submitted so now you can see flow designer basically ran and it has updated submitted and requested as well that means approval has been sent to the manager but do i really have manager if i would not have manager that i can't approve it so if i if i basically check my profile i shouldn't have any manager i think if i come over here maybe i will just select the default view and i don't have manager field over here but even if i just maybe check over here i will i'm just select i'm just checking the list view so that i can look for the manager so i have this profile i will just pull the manager field i have it over here okay so you can see manager is empty so i will populate it this time let's say i will make apple tutor as manager so because i think this time it will update the bucket because maybe it had it has auto approved it let's see did it update the bucket uh okay it's not it has not updated the bucket so if i go to the leave request i have uh okay i have this one so i have not given the cancelled uh state maybe i will cancel this let's let's cancel this i'm not i'm not going to use this i will cancel this leave it is cancelled and i will create a new one now because this time i have the manager so i will select casual leave i will select the dates 12 i will select 15 over here and i will not select anything and i will just click on save if i will do that that means i have submitted the request uh you can see it has also updated these fields i will just impersonate apple tutor let's do that so if i select apple tutor and i come over here and i will go to my approvals where is my approvals i will approvals i can't see my approval okay because i don't have uh that role so i don't have that my approval role that's still okay uh i will end the impersonation and i will go to approval because i'm sure i can see other records as well let's see i'm clicking here my approvals and i just go to all and i will definitely see for other rackets as well because i have admin access and yes i have this one you can see i got this apple tutor and i will approve it now before that i want to basically i will i will make this basically uh form open so i will reload it you can see as of now i still have 24 420 i'm going to take four more days leaves and i will approve it then i will approve it let's see what happens it is approved did it change anything absolutely you can see that as request got approved that means from flow designer it basically proceeded with the next steps next actions we created and it got it approved and then it also updated the racket as per our business rule which we mentioned in our in our in an application so we created that business rule so it ran the business rule and updated the leave bucket now i have it shows like i have eight leaves taken and i have balance as 16. so this is how you also create flow designer and you can see that i didn't even write a single script uh in flow designer and that's what the i would say that's what the power is uh power we have with flow designer i think it is it is really i would say it's it's kind of a really great functionality from servicenow that it will minimize your script uh that that whatever script you write to achieve different kind of functionalities it will definitely minimize the script and and i hope we will reach out to that level like like a low code or like a no code development and that's what i would say it's kind of a no code development for this particular feature which we just added

View original source

https://www.youtube.com/watch?v=rwpLKyEocJU