Transcript for:
ServiceNow Scripting Essentials Overview

[Music] [Music] all right do you see my screen now yes thanks for your patience all of you all right so uh so what we were saying is uh to bring the records directly list down and filter down to 10 records is not possible so we will have to dve a Glide record script right so probably from a bunch of uh 100 100 records we will have to filter down the records take them select them and pick them and then pass it to them to our final query our final query is nothing but current. add query so what we want is list of Records the selected shortlisted records but now how are we going to short list right in order to short list we need to go to the table run up filter we have to put a set limit and we will have to iterate through each record and bring each uh each record S ID either you can bring six IDs or else you can bring numbers also right instead of bringing S ID I'll put number but when you put number what you have to do is you have to make sure here also you change it to number because here you're retrieving the date of number right so in the filter also final query you have to put number is one of so and so uh now so we have seen 10 records but it is not sure that whether we were able to see only the recent 10 or the old 10 it could be a mixer of anything so how do we restrict it to recent 10 we have restricted it to 10 but how do you make sure that those are recent so we will have to do g. order by so order by represents ascending order by DC represents descending so we'll do descending order and we will use number field instead of using we can use created on opened on anything but you know for now we will just use uh number or else let's put created on only why because is when you put number what happens is uh all the incident numbers will come on the top and then uh change numbers will come on the top incidence will come on the bottom right if you see alphabetical order see comes before I right and uh problem tickets will come on the last so uh it will if you uh you know order by descending based on numbers it will be restricted to only certain list of uh uh specific task based records instead of that you want to see all the task based records but only based on a date or a Time Field then let's put this one okay so I'm going to save this record and we'll do a refresh here so previously it was showing uh you know combination of chg GPR and all of that now you can see I'll do created uh I'll show you the created field okay so the recent T it says 7 months from now don't worry about this it's showing the future records basically any system should not show created as in future right but this is a demo instance and all these datas are demo data populated by servers now so that is why you're able to see the future data otherwise in your original company instances you will not see something anything weird like this but you understood right it filter Down based on the available Bunch it filtered Down based on z2a so the recent ones any questions on this so if if we choose applies to table as incident then what will be the parent. CID will it be parent. color okay let us put incident now we've changed it from uh user table to parent and now uh yeah parent. caller or parent. opened by either you can parent represents incident okay now uh so incidents open by or incident scholar whichever you want to [Music] apply after after that um yeah everything else is same and uh after saving this you will no longer be able to see that uh related list on user table you will be able to see it on incident table only right uh now you remember that I told you a shortcut about this uh V gr right so I'll give you another place where these are stored so in left navigation you have something called syntax editor macros so here out of box out of box means as a package service now gives you some shortcuts and the script for that you can also create your own ones so when you put B gr and you press tab in keypad you have this tab tab right so automatically this script gets autop populated and same wayse if you put F and if you you put uh uh tab see what did I do f r and I press tab so I can see this this script called populated so from where it's getting populated is from this place uh similarly info so these are nothing but shortcuts right like that you can create your own shortcuts also like that I can put where AB C and I can put so wherever you feel like you want to print this bun of text will work only in script section so you just put where ABC and you press tab what happened I'll do a Reload form all right right so I did where ABC and I pressed on tabs so whatever I pasted up here it comes up here so these are the shortcuts you can create your own shortcuts as well and uh you can just go through the existing shortcuts that were created uh you know outer box if there isn't any question forther two relationships we can jump into our next topic SLA definitions so do we use this regularly this code this type of uh related lists if you are in a job of real in real time project yes yeah if you're in a job of administration you would not require but if you're in a job of developer this is like step one without this you will not be able to do anything okay right right record um I will repeat it again okay what are the operations of admin okay uh yes yes okay see uh so far so far in our first 10 classes you would have seen like when we change this field this changes UI policy uh we have created a dictionary entries and all of that right so very less coding or no coding do the configuration changes right uh changing some system configuration of people changing branding editor and scheduling clones migration migration is very important role of a admin like moving update set from one instance to other retrieving update sets so all these are roles of admin but uh scripts might look little complicated at fast but if you see uh this is like one formula here if you remember this formula you can apply it everywhere so just put some efforts on remembering this for that only I explained you each and every line meaning this one is nothing nothing but equivalent to going to a table first if you want to look at 10 records let's say I'm saying that uh hey uh can you get me uh 10 um okay let's say I'm telling you that I'm telling you that I want to see the list of uh uh 10 10 uh email records 10 user records wherein email uh starts with AB oh we only one 35 okay anyways everything is the everything has more than 25 records fine so I'm telling you that um I want to see the list of uh user records wherein email starts with KR so this is the requirement let us say so what you would do is uh if you if you were to do it manually what you would do first you will go to cisor user. L right this is the first step how do you write that in code now V user just any keyword USR or Ur any anything it can be any name variable name is equal to new because I'm going to type it new right like your in your memory just put it like that I'm going to type it new so it's called new Glide record so this is a function is important that you have to write it like this first letter has to be capital and second letter also has to be Capital it's not like camel case or small letter fully Capital nothing so each of the first words starts with capital and then open parenthesis close paranthesis and inside that you put your uh table name which table you want to go right now you've gone to this table job done next what you will do you will open up the filter right so how do you open up the filter in script us sir so that filter has to be opened on this table right so this table going forward will be called right USR dot filters in another words called as query right so I'm going to add query right otherwise you can also put add encoded query both are same but with small difference so I just give enter and here in either single codes or double codes you put it like this and whatever filter you want to put like email starts with what did we discuss Ka right email starts with Ka so I do right click copy query so whatever I obtained it from there I will paste up here email starts with k you do not have to uh worry about this keywords nothing just do a copy paste Job Done Right Next just entering the filter asail starts with will not give you the result you have to click on run button now in script how do you click on run button is USR dot query this is nothing but translating as clicking on run R button okay done now you obtained the records but you need to visit each and every record right so how do you visit each and every record then you have to put while USR do next as in you're iterating through next next next record at that time what I want to do like basically I want to print the list of names like U let us say variable names is equal to Mt cput names plus equal to gr. name uh sorry not gr USR here we are using USR right USR do name here name represents name represents this name if you see the back end name of of this one it is nothing but M N M so I'm putting like this and once I obtain I want to uh use a concatenation with a comma okay so uh how many records are there 10 records right so finally in my names array or variable I will have everything so finally I want to print them print them all so this is a script that we have written let us see if that script is working or not so how do we see is copy it put it in background script like um if you were working on some commands or something you will you will have your own command console right similarly in service now you have your command console in left navigation you have to type BGR background scripts there's something called system definition under that you have background script so right away go into that and put up your script here and give run so it gives you all those 10 names separated by comma Karen and then again a different Karen and Carla Karen Casey right so all these are people who has email ID starting with ka ka and we were able to see that these were the 10 records exact 10 records were printed up here so this is a very simple Glide record you just try to practice this as much as possible in uh this is like basic Foundation if you know this one and everywhere you can just use the same thing and 30% of development coding ends here right so this is definitely basic just write this 10 times for 10 different tables it will automatically uh come to your memory it's like like muscle memory they call right it will automatically come for you all right if there isn't any question we'll jump into s definitions here so here one more question if what we need only what we need only fire records that starts with Ka okay so as I told you the in that table you have to put set limit right of five let's copy this paste it you so you see only five records right okay got it all right so we'll jump into SLA definitions then right so we'll take something uh a recent one so this incident 55 seems to be a recent one all right so uh if you see I think in one of the previous session I explained to the specific patch this priority field is never editable it is actually dependent on impact and urgency right for example you can't directly change your priority here instead as you change your impact right I'm keeping my impact as uh medium and I'm changing my urgen change my urgency to low you could see that priority becomes low now let's say urgency is slow and I'll put impact as high you can see jump to moderate right P3 which is moderate priority so you can see that as and when I change my impact in urgency priority is getting changed how is it getting changed what is the backend configuration if you ask me so we have something called priority lookup rules in left navigation under system policy rules you have something called priority look Cup rules so this is where you define those rules so I've opened this tab uh in for your easy access we have some different set of nine different combinations I'll open one of these records so we saying the system that if impact is high and urgency eyes put the uh put the priority as one we can also Define if me if uh impact is medium and urgency is medium Define the priority as slow so like that we can give our own configurations these are all admin related stuff but it is not necessarily that only admin do develop will also do right so we have given different set of combinations like um when this impact and this urgency combines it will become this priority for example I'll show you impact high and urgency low will end up in P3 impact ey and urgency low ended up in P3 right so this is where you do all your configurations now when does this order comes in place is the sequence of execution which one to validate first and which one to validate second for example let us say for same condition for same condition you have two different priorities defined unknowingly or for some reason based on your order whichever has the least order that will run first and whichever has the highest order that will re run second so whichever run second that will get overridden right that will be the final result so order is important that way but otherwise if you have different set of combinations you don't have to worry about the order any questions on priority data lookups all right if not we'll jump into um understanding how an incident SLA works right so whenever you change your priority workn Nots a mandatory so let's save this up and we now see that the priority is right now P3 so you can see it in under task SLA that there are several SLA definitions created one says Priority One resolution other one says priority 3 resolution right let us understand uh how uh this data is visible to us I'm opening each one of these records right so this one says resolution the other one also says resolution however this says P3 and this and you see data like uh business elapsed percentage start time stop time actual elaps actual elapse time percentage and all of that so what are these and uh uh how are these configured in the base system is the next question right so when we talk about slas you have three types of slas one is service level level agreement the other one is Operation level agreement the other one is underpinning contract in in organizations uh when you work on real time you will uh use 80% slas 20% uh like 15% and underpinning contracts are like less than 5% uh this is 80% 20% and again 10% keep it like that okay SLS means um so let us say an example of uh somebody raises an instance that their D laptop is not working okay so I'm a normal user I'm working from home and my I'm saying hey my D laptop is not working so they say uh oh raise a ticket so what I will do I will go to service now I will create an incident and that get H Des team if you seen all companies H disk is capable of resolving uh laptop issues to a certain level right like configuration and all of that so when I create a ticket and uh when help disc works for me that is called service level agreement meaning hesk is bound to work for me who's a user of the organization who is an employee of the organization so they're doing service or uh uh they're doing some work and there is an agreement for it like they will say I will finish it up in 3 days uh because your urgency or impact is uh medium so they will have their own definitions right now let us say at one point they identify the help Des identify that no no this is not just configuration changes there is some Hardware issue right what they will do they will not inform me instead they they will raise a ticket to uh Hardware team who can repair like you know open up the laptop and fix things so instead of telling me they will open up a ticket to Hardware team now who s and who is Hardware they are nothing but both are teams but different teams right so when there is an agreement between two different operations this is a different operation that is a different operation right LK is a different operational team and uh Hardware uh repair repair team right you call it ID something like that in it has its own name in each organization so when there is a uh agreement between two different teams of the same organization you call it as a operation level agreement and it goes under the concept of OA any any uh doubts in understanding the difference between SLA and OA this you would use it real time and this is one of the common questions in I'll repeat I have a laptop issue I'm a normal person okay I'm a normal person and I uh I want to uh raise this consent to the company so that they will fix it for me so I'm supposed to relas a ticket incident ticket I'll say laptop issue any laptop issue ticket will go to help desk because if it a minor issue some configuration changes or some system update help disk itself is capable of doing it right so I'm a normal user and help disk is one operation team inside the organization so the agreement between the normal user and an operational team is what you call it as service level agreement right but after one day or after few hours s disc identifies that oh I cannot work on it because there is some hardware issues it is not just software it is Hardware I need to um I need to take this to hard now hard uh the help disk team goes and gets connected with Hardware team and they work together now this this help disk and Hardware team are bounded by the contract which is nothing but operation level agreement because these are two different operation level teams right if I directly contact the hardware team then it is called SLA but if another technical team contacts under the technical team it's called OA right if a normal user contacts in uh technical team it's called SL if one technical team contacts another technical team it's called OA clear yes clear okay so yes so ma'am so we do raise some catalog request right that comes under OA or what come again so if we some catalog list for uh some like request for M request for some assets or some kind of things yeah yeah service catalog and all comes under SLA only default there's no concept of OA or underpinning contract you see nothing service catalog means the service itself the word itself says service catalog right so it's comes under the concept of service level agreement okay okay but when you raise an incident uh between two operation teams one operation team is uh when I say operation take it as technical team okay one technical team is racing an incident to another technical team so that you could regard it with OA operation level agreement right but service catalogs are completely slas only okay now the third thing is underpinning contract so what is an underpinning contract is now let us say uh we gave laptop and help desks fixed a few software issue and they gave it to Hardware team so we we saw what is SLA and El contacting uh Hardware team and fixing that other few issues is OA right uh now in our own company let us say I work for a company a y XYZ and that company will also have an Hardware team and they are also intelligent and they will fix lot of Hardware things right but there are very few things which they cannot do it by themselves they have to contact the Venter let us say uh it is an HP laptop okay they feel that oh it is not under my control there is something else you know miserably wrong I have to escalate or take it to my vendor who is the vendor HP so they will raise a vendor ticket to HP now this Hardware guy becomes organization guy and the vendor guy is become different organization so a contract between one organization and its vender organization is called underpinning contract right so SLA is between user and Technical team Tech Team of same company this is between one Tech Team and another tech team of same company right but U is between one Tech Team and and another team from different organization specifically the other organization is a vendor vender means people who give you supplies right like let us say uh you know see for us and all like we buying laptops HP or D whatever you're buying one 10 5 10 like that but larger companies have like they will purchase 10,000 laptops 20,000 laptops so there is always a vender and Company level contract so that contracts in organization structure you call as underpinning contract underpinning contracts right any questions these are just theoretical knowledge but it's important that you understand any questions if not we'll get into practical stuff right okay now uh so we have given the definitions of what is the SLA OA and UC how do we configure uh these things right so in left navigation you type sling under system definitions okay under uh uh service level man management you have something called SLA right so this you have to open up so you can see the table name is contract SLA right you have to create a new SLA definition actually out of box there are several SLA definitions for instant table but I'll show you you know I'll create a new one and show it for you so here you can give it like uh P3 uh um moderate um 36 hours resolution right now so I was talking about SLA OA and underpinning contract right so this is where you define it but the entire process is same like if you change it to SLA or OA it's not like this field is going to change nothing every setup is same just that you Define and categorize whether this is an SL or o or underpinning contract so now we'll put this as SLA and there's a drop down called Target right whether this is a response or resolution let me explain you what is response and resolution right when a issue is when a issue is arrived at service desk now somebody has to acknowledge right in all organization people will say okay even if you don't give an resolution just acknowledge that you received an email you remember like your team leads or managers used to say that when you receive an email from a user that there's some issue you do not have to give the resolution right away at least just tell them email acknowledge we are working on it right so that is the response you give it to the user right so that is what you call it as response and once you take your own time like 3 hours 4 hours after that you fix that issue after that you'll send an email saying I have fixed the issue that is is called resolution you understand the difference between response and resolution right now how do we convert the terminologies into service now when somebody's assigned to a ticket when somebody's assigned to a ticket it means that response has been achieved right response is done when State changes to resolved it means that resolution is done right when assigned to is filled up it mean that respones is Chang to resol it means resolution is done any question on identifying what is a responsed resolution right and this is the name just I gave it for our convenience it can be anything some some you know self-explanatory meaningful sentence and this SLA want this to be running on incident table right and of course I want this to be running on across Global applications this is default you do not have to change now how many hours I'm going to give let us say I'm giving them if it is a P3 I'm going to give them 36 hours sorry um it is zero okay 3 days 36 hours is 3 days right so I'll put 40 hours so when I say 40 hours 3 days and 4 hours right and the schedule sources is it source as in like what is the um uh you know what is the like for example if you click on it will take you to Able call sore schedule I will open up in this in a new tab and show it for you so there's a table called schedules you have lot of schedules defined like there's a schedule called 24 pro7 there's a schedule called 8 to 5 week days I will show you what is an 8 to five week days so as the name justest 8 to5 week days the configuration also will be defined for 8 to5 week days so you can see the scheduled entries this is a schedule name under this you have nothing you know important you have something called scheduled entries which you have to be careful of in schedule entri is also name this name does not matters but however you you will put a start date and you will put an end date and you will see say how many times it repeats so you say that it repeats every weekday Monday to Friday so you have several options like this every weekday Monday to Friday Saturday Sunday so creating all of these schedules also is part of admin job right it doesn't involve any coding so there are several schedules for each schedule you not have to open the schedule and see the name itself is a little self-explanatory let me open up this 8 to five week days the excluding holidays so you can see same Monday to Friday 8 to 5 weekly on weekday is fine but this word excluding holidays right that is handled in the child schedule meaning they maintain an another scheduled called us holidays and they will uh you know identify the list of holidays that they have in the organization like for example per year they have 12 holidays and it will repeat every one year right so it repeats every year on December 25th December 24th like that so um you know 8 to5 we days excluding holidays is that so this schedule will be you know taken care but if there is an any holidays coming inside of this schedule that day will be excluded so when I put uh three days right so when I put three days 8 to five big days excluding holidays when do you think is my end day like end day for uh fixing this resolution so let us say one SLA just got triggered now and I have been given 40 hours 40 hours and I am following this schedule so what do you think uh will be uh the best time for me to close the incident it is before 40 hours what are we now on Thursday right so um let us consider Indian time zone only we 9 in the morning right with Thursday 9: in the morning so 8 to5 okay so 8 to 5 is 9 hours right so 9 hours of today again 9 hours of Friday Saturday Sunday not considered 9 + 9 18 9 hours of 27 36 okay so 36 and again it will come somewhere in the first 4 noon of wedes day yes on Wednesday yes so when you give 36 hours it doesn't mean that you know uh you have to finish in three days it actually follows the schedule that you give so in order to determine mind that you have to clearly put what schedule you want if you put 24 cross 7 right then uh if you put 24+ 7 and if you put 40 hours just exactly calculate 40 hours from now 24 uh it it's it ends somewhere in the uh middle of Saturday right so accordingly you have to put your schedule now so I was telling you that let us consider I time zone right so what if somebody's from a different time zone people work in an organization on different time zones right as in some people work from us some people from UK some people from India everybody has their own time zone so which time time zone do we have to follow that is the next question right then we will put either col time zone or task location time zone callers location time zone so all of these is there these are the available options if you put SL definitions time zone here you define a static time zone like you put Europe Brussels so you mentioned static right any regardless of whoever the caller is and whatever is the time zone it will follow by default this one right so in um what else should I say okay so instead of uh giving SLA definition if you give no schedule then it will fall over 24 cross 7 if you give SL definition you have to give what schedule you want if you choose incident field you have to choose see here you have list of you know available options here okay we do not okay so uh you have assigned to schedule right meaning uh for every user record you will have a schedule mapped for it so if you want to match that schedule you will give it here so this is all with regard to this and this this is like enabling and disabling this enable logging is for like developer uh as in if there is some issue and you want to debug it you just keep this debugging enabled it's called debugging so you keep this enable debugging but generally we will not leave this enabled because this isn't anything complex to debug or anything so we will leave always as such and okay so there now comes the other big point when you want the SLA to be starting and when you want the SLA to be paed and when you want the SLA to be stopped uh and reset right so um let us imagine this is a P4 response SLA so as I told you response slas will be uh triggered when assigned to is empty right only see when a ticket is created obviously assign to will be empty right so at that time you will start your SLA and this SLA will be stopped when assign to is not empty so it will start when assign to is empty and it will stop when assign to is not empty any questions on this right so let me explain you now resolution when I'm expl resolution SLA I will also cover the PA and recent conditions so this uh we will start the resolution SLA when assigned to is not empty because the moment it was assigned to somebody their time their clock will start for them to work on so they've got how many hours to work 40 hours to work so as soon as assign to is filled up how do you say assign to is filled up is assign to is not empty at that time they clock start and it will only stop when state is state is one off resolved closed resolved or closed okay fine as I told you in insent we have a concept called on hold right on hold awaiting color so um if there is an information pending from caller uh we should not uh make the assigning worry we should not make this person worry that oh my incident is running out of time and all of that so at that time we want the system to pause the clock so we will put the pause definition as state is on hold right now whenever your state is changed to on hold and saved at that time the clock wherever it is it will pause now the clock has to resume right so you will put your resume condition state is not on hold and state is one of new or in progress we will not consider result close or cancel because that we are considering it in stop condition right and now again you have cancel conditions so when state is cancelled we don't want the SLA to be running we don't want the SLA to be closed also because because when the ticket itself is not being worked upon it is canceled why would you want to you know calculate the SLA which we are going to define the SLA also to be cancelled and reset reset is yeah let me give you this explanation let us say uh service desk works on this okay service desk this issues about what my laptop is not working and they're working on this uh now they identify that it is not a software issue Beth angelin is working on it and Beth angelin you know identifies that it is not a software issue and it is a hardware issue there are two things angelin can Angeline can own this ticket own this ticket means keep this ticket as such and create a new ticket to Hardware team and which will follow OA and parall follow up with that uh Hardware team ticket and whatever update they're getting from there they will come and paste it here and they will say to Carol that hey Carol I spoke to Hardware team they said so and so blah blah blah otherwise another thing service can do is oh my God I don't want this I let me give it to some other team so what Beth Angeline do is I don't want credit of this ticket I will directly reassign this to Hardware team if they do like this at that time it is gets assigned to a different person David right now uh Beth angelin has already taken 30 hours of time now is it justifiable that David Lou is given only 15 hours remaining 15 hours no right he needs his own 40 hours because just now the ticket got assigned to him now we can put reset condition res reset right wait is it again it got stuck oh is it not recorded so [Music] far hey was it not recorded so far yes it's recorded okay because I just got a voice that your conference is now being got got little worried all right no it's it's being recorded but screen is not visible how it's visible yes should shouldn't be a problem all right thank you okay so coming back to reset condition right so as we told uh when the ticket gets moved from One technical person to another technical person uh it is not justifiable that they get the remaining SLA they need a fresh set of SLA because they need their own time to work on it right so we will give reset condition right when assigned to changes from one person to other person reset the condition now what happens to the already existing SLA the to bet there is already one SLA running right so do you want to complete that you want to mark that SLA as complete or you want to cancel the existing SLA so this is what is your reset action so we will say uh give complete see when you give Market as complete it means that you're giving credit to the work they've done when you configure it as cancel we're not giving credit to their work right so uh all these okay now I have given you some scenario and all of that right generally in organization it comes from business process owners you do not have to worry about it but you need to know when and they ask you something where do I change it oh I have to change it here I have to change here so this is what um you need to know F any questions on on this okay I will tell you what is an retroactive start okay um so when they say there is about reset conditions okay uh now uh okay so for two days Beth Angeline has been working on okay and finally Beth Angeline feels expertise or it is a different thing so beeline reassigns it to David L now the to SLA for This is 40 hours beangel already taken 20 hours imagine now is it good to give David L 20 hours or 40 hours if we feel no no you should have only 20 hours then uh we will not give any reset condition but if the organization tells that no no give uh uh we should give the next person full amount of time like 4 hours means then you have to Define the reset condition so in reset condition we are defining that whenever assign to changes the SL has to the clock has to reset from starting like in phone or in your alarm clock how do you do a reset right in stopwatch timer like that uh the clock gets reseted but reseted as in the Old Clock does not get reseted it creates a new entry but now what happens to the old entry you want to Mark the old entry as cancel or complete as next question right so that you can Define it here you want to Mark the old SLA as cancelled or complete that you can Define it [Music] here right okay so there is the uh retroactive start and retroactive pause right so uh this will work based on retroactive start will work based on the reset condition and uh you will uh you will get to choose from where it has to start meaning you you're giving uh 40 hours right 40 hours from create a date 40 hours from created date or 40 hours from updated ticket updated date or again an extra 40 hours from actual end date right now you're going to reset and you're going to Define some hours in that resetting also uh that 40 hours you're going to calculate from created date or the last updated date or you have several other date fields in incident so everything shows up here so people generally either keep a follow update the last updated will obviously be in the last five minutes or something so uh a lot of organizations keep the set start to in retroactive start as uh last updated any questions with regard to how do we configure an SLA or OA or undering contract everything is same configuration with everything is same with regard to the type just that you need to categorize and understand from the business which contract is this any questions all right I can show you a sample incident how things uh you know what are the each component of an incident so as I told you there is a clock timer that get running so it gives you the names of the SL definition that you have and what is the type and what is the target is it a resolution or a response and what is a stage right is it running or cancelled record instead it is the result meaning for this incident what is the scenario what happened that is the result excuse me ma'am yes tell me the one which we create now the one SL which we create now is applicable for that particular incident only no no is applicable no no it is applicable for all incident table like sorry all records of the incident table uh we will not create uh know SL definitions for each and insurance for one day ins right how can you create SL definitions for each and every insurance we will create one configuration record and as and when the conditions get satisfied it goes and gets attached to the respective insulin so as you said this record right this uh result record applies to this incident only mhm now in this data I can show you what are the other fields that we have so this definition follows up a schedule of 8 to 5 week days and the time zone is America's Los Angeles and it is right now running and there is a check books called breached what is a breach right in general English language breached means the time has elapsed like crossed so for example if I'm giving you a assignment I'm saying that I need this to be finished by tomorrow morning 7:00 if you finish it before 7:00 good it is not breached if you finish it after 7:00 or if you don't finish it whatever it might be then it is a bridge right because I have given you a time slot to finish this you have taken more time than that to finish it or not finish it whatever that is what you call it as and now whenever can you uh can you mute your audio thank you when you uh whenever a SLA gets triggered there is a start time and there is a breach time breach time it will be you know marked only when the tickets attains the breach date so for fresh tickets you will not see this field populated only it attains that breach thing it will get this populated and stop time stop time will uh get populated only when stage becomes either cancelled or complete until then it will be empty only an actual elapse time there's a difference between actual elaps and business elaps actual elaps will always calculate based on 24 cross 7 business elaps is based on what is the definition you give in this SLA definition you have given based on callers time zone you want 8 to five week days right so business elapse time will be calculated based on 8 to5 week days only so generally if you see it has taken 156 days but actual business days how many days it has taken is 42 days right right so the same thing they will also this all these things we do not have to do I'm just trying to um uh like uh I'm trying to do an uh a split of uh to understand like you know I'm doing an autopsy of this particular record and telling you what which means what and how it works all these are done by System we not doing anything our job is to create this SL definition this SLA definition only we will create otherwise system will take of take care of everything right from populating start date start uh stop time breach time as breached all of this system will do so as I told you the difference between actual and business is actual follows 24 CR 7 schedule business follows whatever schedule that you have defined in your uh SLA definition now it not only calculates the number of days in uh um days in you know hours passed elapsed means like crossed elaps means crossed it also calculates the percentage for example uh you are given how many you given one day right but you have taken 42 days so it is uh in fact like in multiplied by 100 right 42 multiplied by 100 precisely so it comes to 4200 uh uh the percentage comes to 4200 and how much is the actual time left and elapse time left nothing because they've already got breached and it is already uh going beyond what is the given time so business time left is also nothing actual time left is also nothing and you have something called show SLA timeline so it will give you a schematic representation of what is the like you know it will break it into chunks and it will show you how that SLA went uh so far please me a minute right so this SL timeline gives you a debrief of whatever happened right like uh it says 142 days right so it shows your calendar representation of each and every day but you don't have to worry I mean it tells you exactly on which day it got breached or on which day are you at currently and all of that but you don't have to look at the expanded view of the timeline but looking at this itself will give you an idea of what is happening right any questions of understanding each and every field any questions if not uh done with the SL definitions we'll get into the next topic all right um so our job is to create SLS only right develop yeah yeah our job is to create SLA definitions in order to create you need to understand some functional aspects of this right uh I mean they will not give you like they will not give you please enter uh they will not give you like please enter table as incident please enter this as this they will not give you direct or like a baby they will not give you this thing they will just tell you that hey we want to create an SLA definition for site it team uh you could use a you know two days SLA they'll give you only this you will have to give them questions okay when the SLA has to start and pause and stop so you need to have some business understanding and Technical understanding right so that is why I'm trying to explain what each Fe field represents and what is the end output like once uh incident gets created what what each field represent and all of that because uh when you walk on your Tool uh it is important for you to understand how the tool is also for the end user because end user might ask a general query question also I don't understand what is this like that they will ask so you need to tell them like okay this is something because that is part of tool administrations right all right so any questions so far fine so that is it for uh today with regard to SLA definition and we saw something with regard to related list so the next topic we could cover is import sets um we have uh 20 minutes more for today's session would you like to take a 5 minutes break and come back just 5 minutes off from screen time and uh we'll start at 9:45 what you say precisely at 9:4 yes all right I'll go on mute but the recording will still run make sure to be back at 9:45 just keep your speakers on probably you know so that you don't miss it hey hi guys there yeah okay I can see all right fine so I hope all of us are here now so finally we'll go to import sets Okay um yeah so uh coming back to import set let me explain what is an import set okay so there are several ways you could populate a database right meaning you can import xmls you can import Excel files or you could connect it with other uh third party tools and uh you could import the data on a scheduled basis there are several ways right so I will show you how do we import the data through Excel for example let us understand that new this new instance was purchased today and the HR teams is telling you hey can you I have an Excel of all the available uh you know employees of my organization there's like one lakh employees it is difficult for me to manually make an entry in the user table uh can you can you developers do a favor can you import this inside of service now this is the ask from the HR team now we will not be able to do a import just right click and import note that is not possible if they give us an XML data then it's easier what we do is generally we go to the specific table it could be an incident table or user table whichever table that they want to populate we will do right click import XML job done and we will attach the XML file but if this is an Excel file uh we have to make the system understand okay there is one column uh the this column has to be mapped to this field this column has to be mapped to this field all these you have to make the system understand right for this you require some development configuration this is something very important and all of you would have at least you know one task in a month like this not just manual upload I will show you other see um the basis I'm trying to explain you that how do you import data that import data is via Excel right but not just an Excel file it could be from third party machines like uh I mean third party database like uh uh you have active directory right if you want to import user records from active directory not an Excel file as such but an active directory or you have jdbc so through a jdbc connection from other source any uh uh any uh any other server or database you want to retrieve some information so all these you could do from uh using the input sets that which we are going to learn today so let me do a group by uh type so you can see that there are 13 Excel files yeah few Excel and few CSV files and few jdbc uh uh jdbc data connections and two elabs so I will explain you what is uh ldap connection and jdbc everything follows a transform map and an import set please allow me for a second I'm sorry all right apologies again so as I told you there are different types of data sources uh everything finally drops down to a concept called Excel and imports it and transform maps on top of it there are some Fabrications like what is the you know source of information the source of information could be an L app or the source of information could be a datab jdbc database or the source of in information could be an Excel file right uh I will teach you how do you handle with an Excel file so once that is clear with you in 10 minutes you can learn how to handle with the jdbc and L that is not a big deal the main component is you have to know the structure of how do you upload Excel file develop configurations form uh you know develop configurations on it and transform the data to your service now table once that is done developing the same on jdbc and ldap it's just a 10 minutes job so having this in mind uh listen to the next you know 7 Minutes of this uh um today's session clearly so as I told you let us take a very small example of user table so trying to populate the informations of um probably user ID name email three fields for now okay an Excel file open so you need columns right so probably I'll put name username and then email these columns is fine for now let us upload only three uh these three details and I need to be sure what is the Excel columns that I give right and it is always important first row is always the uh the I mean first row of the Excel is always the header Columns of your fols and service now so name column front front end name is also name name column front end name is also name back end name is also name you see back end name is also name only so it's fine uh upper case and lower case doesn't matter so I'll just put name and same with email ID also the front end name is also email backend name is also email right look at this that is also fine but what about user ID let me do a show matching for user ID um the back end name is user name right so it will be always better if I can put the exact names user uncore name otherwise you can also keep it like usern name but after that you'll have to be little careful in mapping the fields that I'll tell you so let us say l voni v right so username is lk1 123 VT uh 456 vs 789 lakshmi. snc abc.com oops oops copy paste paste resarch um right so this is the simple user data I have let us test it with only three records uh it doesn't matter how many records you have you can have lack of Records in your Excel or three records everything follows the same logic so let me do a save this file user data demo snow I'll go to my service now first step is I will do load data because I'm trying to load the data right so I'll do load data so it takes me to a page and your um okay there are two types of tables right one is your actual tables the other one is called import set tables what is an import set table is those tables are available for only admins and these are also called a staging tables I'll type it for you staging staging means like that is a middleman like you cannot directly upload your Excel data into uh user table right inst of that you want a middleman you're saying that hey middleman keep these files for some time keep these records in your table for some time and then can you just give it to user table right so that middleman is called the staging table so that uh that staging table has to have same set of field same set of table structure as same as your user table but you don't have to worry that oh should I recreate user table no nothing like that so what you have to do is it asks you whether the Imports a table otherwise the staging table or temp table is it already available or is it already available or uh uh you know is it the first time you're trying to load this data so I'm saying hey it's the first time so please create a table for me when you say create a table don't worry because this this is called an input set table and it will be available only for admins and it is used only for this transformation process like transforming data from Excel to transferring data from Excel to your main table so put import set staging I'll just give a name okay input staging user table right I can give any name so I'm trying to give a sensible name here so automatically automatically it forms a backend name of the table job done now uh what is the uh you know what is a retrieval method of the data that you have do you have data source or file it's asking I'm saying right now I only have a file so I'm uh it's asking me to choose the file so whatever the xter file that we already have I'm going to choose it and then it asks us what is a sheet number because Excel tends to have multiple sheets right so saying sheet number one and header row which one should do you want me to consider as column headers I'm saying number one number one is considered as first uh you know the header columns that's all right I'm giving submit before I give submit let me show it to you so I'm copying this backend name that was generated by the system so I'm pasting it here and I'm putting l you remember a shortcut I told you like if you want to open up a table let's say s user table so you always put sore user do l in caps so it opens up the table in new tab similarly now in this page I understand oh this is going to be a table let me open that table right so I'll paste it and I put dot l s and I open that in a new tab you it's says that no the page looking is not we have not given submit and end the table is not yet created but now let me give submit it will take a couple of seconds after that okay so do you see the message creating table _ input staging user yeah table is created now if I refresh the same screen it will say that K table is created and uh how many fields did I put in here I put three Fields right you can see all the three Fields would have been created on this table name email username right the other ones and all is like common like as I told you in any table you will have Fields like uh uh created created by updated updated by like this uh you will have the tables and as a special as a combo for uh uh staging tables you will have Fields like rows um let me bring everything to the right for you to see among these only the name username and email ID is are the one that is created by us otherwise updates updated created by everything El was created by the system and each one has its own meaning for example there is one column called row right there's one field called row so it tells you in Excel you have rows 0o one two and all of that right so in Excel what is your first row first row is lakmi warun and vnav so Lakshmi Varun vhn right row number zero row number one row number two it gives you information that way so like that each one represents uh an item let me jump into the place where it said table created so it said that three records inserted and no in this table it is a fresh table right so three records got inserted and that's all and um if you click onto this it will take you to this table and uh now now that these records are in this staging table you need to carry this and put it in your user table right that is the next main goal create transform map transform map means transform the information from staging table to main table since this is the first time I'm going to create transform map if this is second time I'm doing the same job I don't have to again and again create a transform appap again this table creation also happened because it is the first time second time I don't have to do this I will click on create transform map so I will just put uh uh map user data this is just developer name right anything you can put so I know that the uh staging table is this table and Target table is cisor user so I'm telling my system whatever data I have it in my staging table I want to push it into the user table according all right so there are other few Fields here don't worry about them right now so these are the two mandatory Fields right so I've done that and I'm doing right click save I will explain the other Fields later but now you have something called autom map matching fields and mapping assist right let me show you mapping assist first so when you click mapping assist system asks you which field do you want me to map against which field for example these are the fields of your staging table in that especially you want name um username and email right so this name you want to keep it uh map it under these are the fields you know manager middle name notification password uh employee ID all these are fields of user table in this I'm going to look for the field called name that name and name got mapped username is nothing but user ID right here what do you call it St user ID user ID and for email it's email only okay so it is not mandatory that you should have the exact same name you can have some dummy names also but you'll have to be careful mapping the right way you have to map it right correctly okay this is one way of mapping I'm doing cancel I'm not saving this is one way of mapping the other way is that we are uh we are seeking the help of service now's intelligence to map it by it own so we're saying Auto map Auto map matching Fields so when we click that let's wait for a second it'll automatically map Fields it will not ask cover suggestions it will automatically map Fields you can see that name got mapped to name email got mapped to email got mapped to email but you can identify that usern name did not get mapped right reason is because as per service now intelligent intelligence it can see that oh name name common email email common but here here it says username but I cannot find any field that says as username in my user table so it was not able to do it so here you need mapping assist so here you have to manually map your username with user ID right save now you understood right so it is not mandatory that you have to put the exact names here but if you put proper names it's easier for you to do it when there are 100 uh 100 columns right at that time you don't have to worry about mapping assist you can just uh leave it to the service now intelligence it will map it by it own right you can see that this field gets mapped to this and all of that done job done and you have a button called transform which is nothing like run so you click on transform and it tells you that your import set table uh um import set table uh this table is getting mapped to ccore user table using the transform map called map user data so I'm saying yes good go ahead transform right so I'll have to wait for a couple of seconds I can now just validate in my user table that these three records should have been created okay this you can ignore it says 11 minutes from now right this is not ours this is something uh from the demo data this you can ignore RS is these three you can see these three records that have been inserted on the table right what we showed is a very small example like this you can load LS and lacks of Records now as exercise you try to do this in your uh uh personal instance as well just get it started with and tomorrow session we will look at in detail about what each components represents and how uh how better we can play with this import sets and what are the Logics that we could put and I will also finally explain about other types of data serves apart from Excel such as uh jdbc data source and ilap dat up Source any questions for today so once we have uh added you have added only three list right three list right correct correct only three user details what if you want to add more details after importing after importing if you want to add you create a new Excel or you just put U you know 100 records 200 records here and do the same procedure now let us say okay I'm appending two more records in your mind you imagine this is plus 200 records okay now step one load data same as we did last time here we have already created the input set table right in your memory you remember that input set table so that import a table name is import staging user table so you have to give table as existing table and you have to select the exact staging user table all right and now this time also you do not have data source you have only Excel file so you'll choose Excel file same file have I saved it yes I did I'm going to submit now I no longer have to worry about creating a transform map you can see that there is one new Option called run transform available last time it was not available because system identified that for this staging table there is already a transform map available in my system so you don't anything else just go ahead and do run so when I click run transform it will tell me that these are the available transformation Maps available we have only one available right so it says that only one and it gets a selected map use data so I give transform so you can compare the difference last time it took me like 20 minutes because that is the initial first time setup but now it took me only 2 minutes so now again I will refresh my user table data you could see that these two records I just created right R r546 zdb GF right yeah got it got created up here so first time installation alone you know setting up of the configuration data alone takes some time like 20 to 30 minutes the next time it's all routine you can even in fact schedule it a lot of organization have an FTP file path right so in that file path if they can drop uh different different Excel files every day or every few hours we can create a schedule inside of service now and our job is done we don't have to monitor nothing uh it will automatically fetch the files it will do transformation M and everything can be scheduled as well that also I will explain in detail in tomorrow's session any question question so far okay questions we'll stop the recording for today regarding uh you know uh related list uh people are trying to create my last 10 uh transactions right uh first of all don't get carried away with the name my last 10 transactions it is nothing but um we are going to take my last 10 Open tickets right or else uh recent recent tickets recent task opened by me so that could be the better name right uh so Joi me messaged in WhatsApp that uh she's able to see literally all the task not just uh the last in so how do you restrict it to only 10 right so I'll show you an example that is not uh straightforward you can't just you know put it in one line you might have to write a Glide record and do that so I'll give this a name and uh this relationship same name I wanted to be appearing on my incident table so applies to table is nothing but incident table and I want to look at the tasks of incident change problem whichever was opened by me so where where is that one table that I can get all these record the only one one table is Task table because this is the parent of all the CH all the other tables like incident change problem and all of that so I will choose task right now so you might you guys might have put current dot add [Music] query opened by same as current do col this is what you had put right or current. open by like the same as mine actually we have selected applies to the table as user user system sore user instead of incident okay so uh you will be seeing the data in the user table right so you will be seeing the data in the user table right so still I didn't see any uh the data in user table also okay okay for example let us take your scenario where you want to put this on user table so let me choose uh table as user and uh queries from table as task okay now current. add query CIS ID open by is nothing but current. S ID accordingly it will change where you're applying and from where the records are coming from let me do a save and uh I will open up able [Music] tutor configure related list so the name is recent tasks opened by [Music] me right so I do a control F recent tasks opened by me right so I push it to the right and save it so it brings up the data but when you click on task it shows up nothing uh reason could be because there is nothing on uh a J's name let us cross verify right that is why so he doesn't have anything on his name so let us uh find records uh where people have you know what are the records opened by which people and we will take their user record okay in system administrator we have this many right so let me go to system administrator profile and if I scroll down let it for load for a couple of seconds for all right uh so here we are uh you know mentioning that we want this uh relation should be available on user table and the data coming up should be from task table so here we put up a query that um I want to look at the records where in opened by is nothing but parent right this is parent par parents Society so when we applied like that we could see that under user table we can see this related list and we could see this 851 records now the concern is why am I seeing 851 records I want to see only probably a restricted to 10 records something like that right so coming to that question that is not direct or straightforward what you might have to do is you might have to quck quy the entire list and take the last 10 records so how do we do it is you have to write a Glide record um I'll give you a shortcut um in your uh you know in your workstations you just have to put v a r gr R and in keypad you have tab right tab tab so you just press on the tab so you will get all these scripts pasted by automatically I will repeat in the initial phase instead of writing every line by your own self what you can do is there's a shortcut v r gr okay so this is the shortcut key for that and you press on tab in your uh uh keypad so this entire scripts automatically gets pasted now I will proceed to explain what each line represents so variable is my object initialization and the object name that I'm giving is gr instead of that I can put ABC anything so if I put ABC here I have to make sure I have to put ABC ABC ABC everywhere so gr is like short form of light record okay so it's like handy so we put gr and which table you want to Glide Glide means like you know passing through right gliding through the records so which table data you want to glide through you want to glide through task table data so we'll put task and what is the query that you want to put so basically you want to put uh the query Asen opened opencore by is nothing but parent. CID right and um and you put up this filter then you give run right G query literally translates to run and then while while iterating to each record we're going to do something what we going to do is uh we will uh store the values of active societies task do Society gr. societ so this is going to be multiple records right like it's going to be 100 records 200 records so we need an array to push this so we will put where Rex is equal to array initialization so we will do rex. push of g.s ID and F finally we will put add querying opened by I will once again explain the script but just watch it for now opened by is open by is one off right is one off means I in comma Rex so this should do the job I will again explain this um okay what is the meaning of first line this first line is Glide record of task right it is nothing but literally taking to T.L so the moment you write the first letter imagine in your mind that system goes like this sk. next you put one filter right so what do you put the what do you put the filter as opened by is system administrator right okay so you put up this filter now do you how many records do you get do you still get 968 why are you getting only 96 you should have got like 20 or 30 right the reason is because we need to click on the Run button right so just translate this here this new Glide record task is nothing but opening up the task table and then you're applying a filter saying opened by is nothing but this particular society here it is directly we have applied this uh system administrator now just with this line you will not be able to fetch the record you will have to click the button called run right only then you will you will see the limited records so when I click on but run is nothing but gquery click run right and this is go to table first go to table and then click run so once you click run there is a possibility that you could get one record or multiple records right if one record then you put if if you put if if multiple records you need to put while right so this is the logic because we are trying to iterate iterate means like walk through each records one after the other so here we know for a fact that it's going to have multiple records so we will do while right so while it iterates through each records each records of the task see going forward the task record will be represented by the keyword gr gr G so wherever you see gr it means that a specific task record so whenever it iterates through the records each next record we have already initialized an array called re CS right inside that array imagine that array is like one box okay inside that box you're pushing your socities socities of this task like push this push the taskid push the taskid finally let's say it goes into 100 times okay it goes into 100 times so you'll have hundreds SIDS finally at the end if you print if you print like gs. add info message like that or error message something you try to print the uh array at that time you will be able to see that you will be seeing all that values comma separated now finally you know what are the that you want to filter out so you'll put current. add query opened by same okay but here I in represents is oneof there is a symbol for everything equal to equal to represents validation equal to represents setting up likewise this one represents greater than all of that right so is one off is nothing but I in I can show you another way so let me uh show you this example of is one of how that operator is formed so you have is is one off and all of that right let me put is one off and I will choose some four uh four things in the states and I will do run when I go a right click copy query and I paste it somewhere in the notepad I can see that state I in - 51 2 3 which means state is one of - 5 1 2 3 minus 5 represents pending uh one represents open and goes on right so now you understand where I got this in in right so in in Rex now even now your requirement is not satisfied you wanted to see only probably five records or 10 records right so you have to set the limit so what you do is before you click on the run this is nothing but clicking on run button right you have to put another line called gr Dot set and here itself it gives you a oneliner understanding of what this means you can read it for yourself it sets the maximum number of Records in the Glide record to be fetched in the next query like you are setting up um limit how many records can I see like that so let me put like 10 alone now okay and I'll do a um finish it up with a semicolon now I'm going to save this up right [Music] okay it gives me an error message that native array so this happens usually when you do not convert your value to string so let us convert the value to two string so two string is a parameter uh I mean see you're getting lot of arrays right it Still Remains as an array so in order to get that converted so you put up a keyword called two string so it is again a camel case the first word starts with complete small case and the second word starts with first letter s upper case so this is what you call it as a camel case and uh you put the paranthesis and finish it up so let's test it now okay still I get that just give me a [Music] minute for for oh all right so you have your 10 records here I will explain uh the modified uh code now so there's two ways to bring it either you can use it array or you can use it a comma you know a comma separate array of string so here instead of I'm using array I'm just putting a comma separated but I will also demo it to you how do we use the push and do it now just concentrate on the lines uh which are not commented so uh in in initially we have initialized a variable called vals and after that we're going to a table and applying required filters right and we're putting a set limit like I want to see only 10 records and then we are clicking on run and while it iterates through each records so what I'm doing is this is an concatenation operator right when you put uh uh plus it means it's a concatenation this you can also write it like this vals is equal to vals plus right these two are nothing but one and the same if you cannot understand this one you can use it like this so WS is nothing but already existing WS what is it codes plus plus means not addition it's concatenation meaning uh joining joining one value with another value just keeping next to each other we're not trying to add we're not trying to do an and we are trying to get the task soci right and then SE uh then uh adding a come out next to it and then it'll come to the next record and again adding the command next to it and it goes on like that right so finally at this place what you will get is Val is nothing but the comma separated C ID S ID means unique key right unique key of all the task records that you are expecting so now you've got the 10 records that you're expecting right if somebody has only three records it will say only three but we're trying to set the maximum value as 10 now we put up a filter finally saying current add your current represents task table in task table you're putting a filter CID is one of cety is one of vals do two string meaning the list of socities that I've have already gathered in here so instead of using vals like this you can Al it's hello hello anyone hello what happened might be some technical issue from we will take it from there so uh yesterday how I was telling you is that uh step one to this is load data so you go to uh load data and then uh if you want to create a new table okay I will just do a quick review of 5 minutes whatever was thought yesterday all right uh so when you take a table there are two types of table in service now everything is a table right so the tables that you create are also stored in a table right that table name is sis DB object right so insent change problem all of these are table but when you create the table that creation components is there right that itself will be stored in another table which is nothing but tables table uh the back end name of the tables table is this DB object right so here you can see all your uh incident change right so you have uh uh keyword starting with change you have 15 tables in in the database and you have problem all of these tables and uh not only it has uh um it has the main tables it has import set tables also so for example um yeah see let me show you the tabls that are extended from task so what I'm doing is show matching of task removing all the filters you remember right for example if you have developed more than one filter if you want to remove a specific filter just go to that filter just exactly before that you have this uh U you know icon right so just click on to that you do not have to expand and remove and all so this kind of a shortcut in so in service now we have 41 tables that are extended from task table so all these any for any of these 41 tables if you take it will have all the fields configurations uh notifications everything inherited from task table on top of it it can have its own configurations as well you remember right the dictionary override concept and the custom notifications and all of that now similar to this you have an uh you know extend table called import setro so which whichever table that says input set row it means that these are um custom tables uh import set tables these are staging table right staging staging means uh for example if any type of integration or data sync you don't want the third party uh system to be directly uh you know synced with service now so that uh uh you don't know which one is updated by what and all of that so instead of that you will have a middleman a staging table and you will populate all the data into the staging table which is also called as UT set table which are nothing but we have 11 in the system right now and going forward we can create even 100 also doesn't matter and these are only staging table and uh it will be available only for admins and the records in these tables also would get Auto cleaned Auto removed every once in a month by the system itself you don't have to do anything and the data from this staging table will jump into main table right now how do you load data into the staging table that you will have to use uh this load data UI page soing that um if this is the first time you're going to create a staging table you will choose create table otherwise you will choose existing table and we'll show you all the list of existing staging tables that you have so yesterday we created up a table called U input staging user table right yeah input staging user table is table that we we created so you you you know set up like where what is the source of your data is it a you know a manual file or is it from uh external data source for now I'll teach you file because yesterday I told you about field file only so I'll again explain that Al and then you do a submit so the moment you do a submit if you look at this table you will see all the datas are populated so this is one way to look at so it says that inserts update and all of that right so you open up all of these links in new new tabs so first one is import sets so it goes to the import sets for this data load and the other one is loaded data whatever is the data it it nothing but it takes you to this table here right the second one is loaded data is taking you to the input set table that you just created like it was already there yeah and yeah so this Imports a table it will tell you for the same staging table what are the past history like for example same Excel file on this staging table we loaded it twice yesterday and to uh and it was processed as well today we just loaded and we have not even processed those steps are pending this this you this data you will see it in loaded data uh import sets so all these you open up in a new tab if you open up here itself everything will get collapsed so all these whatever you want to see open up in a new tab so import set gives you an historic data of what is the status of your UT set and this loaded data will take you to the import set table itself and you can see the data and third one is create transform map in our case we have already created but if people have not already created they can use this plays and create but in our class we have already created and third one fourth one is run trans when we give run transform it shows the existing transform map that was already created log is whatever is the logs that has been developed since morning right creat on it comes up here if any errors or something like that it comes up here any exceptional errors now these are the shortcuts to see the data right otherwise the proper way to see is load data is to load your file you have a module called transform map right so under Administration you have transform Maps so you can see all the transform maps that has been created so far by the system or by individuals like us so all these comes up here and uh it should also have um our tables created as well right this one is ours we created a new transform appap called map user data right any question this is just a overview of what we've learned yesterday any questions okay so I will proceed to explain each and every component of now there's a checkbox called compy empty Fields right so what does that mean is so let us say for vavi I'm keeping the email as empty okay I'm saving this file so for vnav I'm letting email as empty so hello yes please I have one question if we write code on if you want to check it uh where can we check it like how to run it this section transform script section transform script is the place where you write that will come up I will explain each component finally these and finally the transform okay yeah so let us say you have a empty field in your um Excel data or data source and you want that also to be copied you have to make sure that you enable this one right so for example let us say this is not enabled and you load this Excel now this empty field will not be copied because wn's record is already created in the system and it has the username so and so and vn's name as an email ID already filled in the system but this field is not checked uh vn's email ID will not be cleared out in the system based on yesterday's import it was already populated right it will remain as such it will not be cleared out but when you enable the this and after that if you load it it will be cleared out right so that is what copy empty Fields represents and then um runscript is something uh you want to uh you know put up a log or you want to do a validation before this transform map starts so that kind of scripts you will write here I will show you with an example um and if you ask me what is the difference between this transcript and this one is so this one is component wi I'm opening in a new tab so that I don't want to mess this uh uh form so I do a right click here and I click open new window okay so it takes me here so I'll click on new so that I can show you what are the different types of transform scripts we have we have these many options right so all start is uh when you say transform map um there is a transform like let us say 100 records are there Excel okay before that 100 records are to be processed there is one few seconds right whatever you want to validate before even first single record is you know processed that you want to validate or process or do anything that and all you will write it in on start right whereas on before is this will be working for every single row of your Excel for example you have 100 rows in your Excel before processing every single row this on before script will run like uh row number one before processing it will run row number two before processing it will run so it will run 100 times whereas on start will run only once before processing your uh entire batch that one second is there right in that time only once your Excel can have lack of Records Excel can have one record 10 record doesn't matter for a whole batch only once at the initial time that is what you call as on start on before before is on before of every single record execution similarly on after is just the opposite of on before after processing of every single record in your Excel you want to do something that is what you do good in your on after on complete is uh it is just the combination of on start right uh once your entire batch is done you want to run some script that you will put it in on complete for example let us say you to send an email uh before this uh this entire batch starts right then you will use a on start uh on start transform script and you will call a event and Trigger notification all of that let us say you want to uh uh you want to send an email uh once the entire set is completed then you will use on complete right or else uh you have a requirement where you want to validate few things before processing each row then you will use on before and you want to do something after processing each row it is on after right now um okay there's something called on Choice create on foreign insert on cont just hold on for this I'll explain another Bunch so that you understand now in field maps what is the main things you see Source field Target Field right what is the source field Source field is nothing but the fields that are available in your import staging table right whatever the fields that are from Source table is called Source field whatever the field is there from Target table user table right those fields are called Target Fields now in addition to that there are few other columns there's something that says colors and also there are few other columns which are written in form layout let me bring everything to the right okay I'll bring everything to the right now um yeah you can ignore about this application created created by and all okay otherwise okay I will tell you what is this call as colas is let us say um uh in for every table you have a unique key right for example in user table you can either say the user ID is unique or email is unique so uh you can have multiple uh uh you know you can have multiple records with the same name with the same name students know I can create 10 records also whereas email has to be unique or at least user ID has to be unique because why user ID has to be unique because this is the login credentials right you cannot give same username to two different people and two pass you know two different password that will not work out so this has to be unique so what we can Define in our system is whatever we feel as unique we will give coas true so uh whenever you see this field qualies in back of your mind you have to think that oh unique right the translation in your mind is it has to say unique and uh um and there is an you can make multiple Fields also for example when I say multiple Fields it's like combination for example um right so I can say in my system that um you can have uh two people like okay there is already something like this in the [Music] system okay so here what I'm trying to do when I am making two Fields coil is is uh only uh if both the fields unique is true and then system will consider as a unique otherwise it will think oh it is a different different record meaning now I have this row right Vishnu do snow Vishnu snow Vishnu snow abc.com right when I keep um when I keep user name as uh unique uh what will happen is it will uh look for if the if in uh in service now user table do I all already have a uh record where in Vishnu do snow is m against username if yes it will go and update the record if no it will go and insert a new record right when I have username alone as Coes so cois determines what is that one field uh which makes you to be sure that whether it's an insertion of a record or an update update of a record uh to be very precise I think I can show you with the incident table for okay so we don't have to worry about any of these columns okay let us imagine we trying to push data like this and and finally we will have one more uh um of our own like we'll say 266 something like that okay and it can be any short description um the caller can be anybody I'm just copying pasting uh from any of the data we will do uh we will leave assignment group and assign to SM smt not a problem let us try to load this data uh so for incident table this is the first time we're doing so let's do it new so we'll say that oh I want to create a new input set table uh import incident and I'll choose the file and uh as I told you sheet number is one header row is one already so you don't have to change that let that be there are 67 records that were inserted right inserted as in inserted in the input set table not in your incident table it was only inserted in the UT set table now you need to create a transform map so um incident mapping Source table and Target table is incident save and here I'll just do automap matching Fields because I know that see this data itself I got it from exporting the Excel of the existing instant table right so uh it is not that I changed the you know column label or anything so I will not have any difficulty in uh mapping the fields so I don't have to you know seek the help of mapping assist I can just trust on the autom map matching Fields so it says field maps were created right now what I'm going to do is I'm going to make incident number number number is the uh unique so I will Mark in number as col is true okay so now that I have marked ins number SC is true if you see we have how many uh data in the incident table we have 60 uh 67 U rows but if you see there will be uh only one record inserted and uh other U 66 66 record will be either updated or ignored in this case it will be ignored why ignored is system did not find any change between the short descriptions or whatever values and whatever is already there in the system whatever you're rece and whatever is already there in the system wants to update it so only you will find there is only one insert of this record right so we have created this let's do transform so it tells you that it is using the transformation map instant mapping and I click on transform okay so I go to this import set it will tell me uh you know the statistic reports in inserts one and you have updates two and ignored 64 okay so I'm curious to know what are the updates let me filter down with ignore right for ignore what it says no field value changes no field value changes right which is fine um let us take the updated one row number two and row number 52 this incident and this incident what did we change in this just one minute ago based on our Excel transformation previously it was can't access SF software and it is now again this thing maybe I'm not sure maybe when we downloaded and we just when we kept it here right we might have added some extra space to it so that extra space Also system considered as a change of uh character length and the wordings excuse so it took that as uh u a change in the field and it recognized that and it got updated the other one is okay this one is closed inc2 row number 52 it said right in the all right so 5 months ago this ticket was closed but uh uh the email uh triggering the email but it anyways does not have anything to do with coales so what I'm am I trying to explain with regard to kis is that when you have that specific field as kis marked true wait a minute okay this is the incident mapping is the team map that we created okay so we had set so we have this field mappings in this and uh we have given number esol is true right so based on that system did not make any uh new insert it only updated so let us assume I'm turning this to false yeah what will happen is you can try this in your system if I reload that same Excel again I will have another set of 66 records newly inserted so that is the you know work of uh um that is the work of ques and one more thing is uh I was talking about multiple Coles right so I can do like this as well like I can make these two combination number and short description combination is uh both of them true so what happens is let us say I have this this one is already loaded and new newly created right so with the same number I will put different short description I'm saving This Record now do you expect the system to create new record or not it will create the reason is because uh it is no longer number is the only coilies uh short description is also become a colis so it will look for both combinations for example it will look in the system with the same incident number with the same short description do I have a record already in my system right and uh system will say yes you have so it will not make any insert fine uh it will ask in the system do I have the same instant number yes next question is do I have with the same short description for this instant number the answer is no so that is considered as an insert it is consider as a new record so it will insert so that is the game of multiple uh uh you know colis happening and um uh this is fine for uh you know fine for uh Fields like uh short description incident number these are string Fields right but what happens with reference Fields like callar assignment group and assign to so those are you call it as referencing Fields now um okay so let us say you have a priority field right in priority what are the drop downs you have you have P1 P2 P3 P4 P5 only this much right let us assume I'm trying to put up in my uh this thing um no severity nil priority okay imagine I'm trying to put up in my system saying that nil priority let me delete all of the records to avoid confusion you will take only few records okay we're taking only four records in one of those records I'm putting priority as n priority but if you see in your incident table in this drop down you have nothing called uh nil priority right uh let me do a right click show Choice list right click show Choice list right I'm filtering Down based on English language um label these are the available labels I have in my system one critical two high there is nothing that says n priority that is a new word that I'm bringing up on my own now in my t-map so the choice action is given as create right so what will happen is if I try to load this data I'm choosing an existing table have I saved this control is saved run transform so which is that incident number that I updated it is 05 let us take let me take you into that I set oh I loaded the data into user table I'm sorry the Excel that I had is incident table but uh uh mistakenly I loaded the table uh data into staging user table I should have done it in incident table so I've loaded the data I'm doing run transform okay so based on Coes you could see that there is a uh new thing that was already create because as I was telling you we have 55 you know the instent number as a unique field we kept two combination right we want number also and we want short description also has to be unique so in that way you could see that these two Fields has been created but uh we still see the priority has not been changed I believe it is because of um it is because of the lookup rules based on lookup rules uh it is not accepting and then your voice is not audible uh is it is is it better now yes right so I was trying to demo you with prity but did not work the reason is because priorities are being set Based on data lookup rules so instead as part of this demo I'm trying to change it in the assignment group and assign to in one of these records I put assigned to with random words and in assignment group also with random words right uhe previously it was proper some there is one group called Hardware there was some assigned to person called David L but I changed it to something and you could see that it got reflected as well uh some text change getting reflected in short description is not big deal because it's just a text right but whereas with regard to reference field it is important meaning these are the datas that is coming from different tables right so how could this word is been recognized is the next question so if you see that uh because of your see you have actually uploaded your data on incident table only right but because of your action there was an consecutive action which got triggered in user Table and there was an user record created with the name as test blah blah blah whatsoever you could see it here right and similarly with assignment group also so I just kept it like hello it's an assign assment group name and you can see that in groups table there was a new group called hello that got created now um imagine assignment group is service desk okay and uh if that name exist in service now which is fine that group already exist in fire service now which is fine it will take the existing group if it does not exist and somebody manually mistakenly unknowingly they enter like this right because human errors can happen at that time you want to create a new group or you want to send an alert email or you want to um um uh you know ignore this entire row that can be determined based on what is the transform map that you develop so I'm jumping into our transform map again so in uh in Choice action there is a default value saying create create create right so if you no longer want this to be happening you have to mention it as ignore right when you mention it as ignore what happens is um let us say you're changing the short description in Excel there's a change in short description identified this change in assign to identified since for assign to you gave it as ignore since in assign you gave it as ignore this change in fail alone will not be considered if it is proper service TK it will considered but if it is a foreign insert identified it will not considered only this field whereas if you choose the option reject reject reject is there right if you mention your choice action as reject at that time it will not consider any changes of this entire row any questions with regard to what is a cois and how do you handle with Choice action ignore insert and uh ignore create reject all right I take that as a noome so you got this right and this coilies you understand what is a coilies so coili Cas sensitive as in um so here we have given uh Inc so and so this number is already there fine but if I change this to um Inc right in smaller case uh does the system has to consider it as a new record or not right like uh you have to identify the characters of the record with the uppercase and lower case exactly same as how you have in your system versus how you have in your Excel if you want that case uh uh you know uh the case validation then you will enable this one otherwise not required again coil is empty fields for example uh you marking short description and as empty and uh in Excel is also empty and in service number is also empty right that you want to consider it as a coas or not so that is the uh thing that is being asked here and this date format uh will be applicable only if you have uh field mapping which is of uh date and time field for example assignment group is a reference field right priorities a drop down short description is a free text like that you have created updated resolved time closed time these are date and time Fields right so let us say you're trying to upload this that data as well so in your Excel what is the expected date and time format fed in your Excel that you have to mention it here this you can ignore this you can ignore and all okay Source table Target table you know Source script I'll explain you wait so that is all now um there is a checkbox called sour script once you enable a script section opens up so uh when you receive the data for example so let us say uh whatever short description you receive uh there is a requirement that you need to take only the first uh three first 12 characters of that like in incident you should not write away copy and paste it instead you have to uh take only the first 20 characters of the short description if there is such requirement then you can use uh this particular use Source script so what you can do is variable X is equal to s force. Shore description do two um two string do substring substring of 0 comma 12 which means that it will take only the first 12 characters or digits or spaces whatever the first 12 uh characters of uh your uh short description that you received in your Excel Source means Excel right Excel and it will store it in X so whatever your returned uh you know whatever is been returned in X will be written here and only that value value will be put into the Target Field right so uh you could make use of your your you want to tweak the data and then populate it right so that is all with all these fields now if this is clear I can further jump to transform scripts any questions okay so let us say you want to uh maintain a logs in the logs table uh saying that um incident incident uh data transform initiated right just that nothing much only this much I want to do so you can put on start so uh once whenever whenever this is uh uh this transform apps get started once uh once for every transformation meaning if you have lacks of Records in your Excel doesn't matter once for the entire batch one time before the starts it will put up a logs in the uh St you know in the uh log statement table same like that complet it I'll do an insert State and let us say on before so um in on before uh instead of just putting Lo validation if um Source dot short description description two string do index index means contains index of the keyword orent greater than minus1 then let us trigger a event an event can further trigger email or whatsoever this is some random name I'm giving I'm supposed to create a uh event with the same name import do insent do Urgent identified urgency identified comma uh on the insurent table comma so this is actually uh you know triggering uh the syntax to trigger an event so you will put like a this is Glide system event Q you will trigger this event on which table incident table and these are first and second parameters for now I'm letting these two parameters uh empty but uh uh when we look at notifications in detail I'll explain we had already you know had a you know had a session I think more than two sessions on notification but I have not explained further on the script part right so that all is waiting because I want you to understand uh uh the events Concepts and alls and later come into that section so when we jump into that one I will also explain you what is param one and param 2 right so uh before I process any record and ID and identify a records short description that says uh that contains the word urgent then I will trigger this event then this event can further trigger a notification or anything right I'll do an insert St now okay on after on after this you can bring up a similar logic like that yeah so I explained you on on before on after on start and on complete so you can see on forign insert right foreign insert is nothing but uh what is the difference between insert and foreign insert insert means you're trying to insert a record insert means you're trying to insert a record in your incident table because this Excel load itself is meant to uh insert or update is fine foreign update means for an insert means uh in incident table you have lot of fields for example you have assignment group field which resides in the group table and you have assign to field which resides in the user table so because of your Excel action there is another foreign table like you know any table apart from inent in this terminology is called as foreign table trying to insert a record in assignment group or assign to all these are uh called as foreign inserts and that will also be done only when your um field mapping Choice action says create otherwise it will be you know ignore either rejector so let us say in assignment group Choice action says insert um you want to allow it but at the same time you want to maintain a log or you want to trigger an email to a specific team to validate it something like that at that time uh you could uh make utilization of your foreign insert transform script again Choice create uh so reference fields are called as foreign insert this category and all is there right okay so priority we were not able to change it because priority is uh autofilled based on uh your data lookup rules based on your urgency and impact but I think I can change my category so categories again a drop drop down field right uh so if I'm trying to change any choice options and it ends up in Creation in creation of a new Choice rather than update the old choice because uh in service now you can't find something called database e e e right so it will end up creating a new one on such time you want to do something then you can make utilization of choice create on reject is obviously if we Define reject here right so that's consider reject but you don't want to leave it as such you want to trigger a notification or you know put up a log somewhere or in fact put up a comments in the incident so you can just put like uh Target do commands is equal to uh XYZ was rejected because of right you could leave that message um on the commence field of the incident So when you say incident table you say it as Target you represented by Target these are the different types of transform Maps we have any questions in this sof far so as part of exercise you can try out uh you know one example uh applying each of these components like you could try uh uh you know choosing uh Choice action ignore Choice action reject create and all of that and you could play around with multiple coales you don't you know you don't have to necessarily restrict with insent table you can try this on any other table uh but but in our scenario when we were trying to play around with priority we saw that it wasn't working the reason is because there was a backend logic with data lookup roles right so these are few things that you might have to be uh uh pre-informed so that you spend lot of your time trying to debug and all of that since we already know that priority is handled by uh um impact and urgency we didn't have to spend time in debugging oh why did not get updated and all of that so this you'll have to be little more sure any question so far if not import set and transformation is done I will jump into uh data sources meaning apart from Excel what are the different other uh uh ways we could bring in uh data inside of service now all right so it's talking about data sources right so let me take you to uh this this place and it will tell you what are the different types of data sources we right now have it in our system so I think yeah I showed this to this batch yesterday uh we have uh jdbc ldap and file file represents it can be Excel CSV whatever kind of file it could be uh it accepts only CSV Excel and UHS and jdbc so there is some um see um we are doing this for demo so we cannot show you a real time uh some server and and show you how it is being connected instead there are some existing things uh I can explain what each components means right okay so whenever uh um any internal teams of your organization contacts you stating that we have a jdbc uh you know we have a server database and through jdbc connection we want to send the data to service now if they tell you you need to ask them for very you know limited information as in uh can you please uh create an authentication like uh create a user account and password uh for our service now in your database and make sure it has access to retrieve files right so once that is done they will share with you the username and password whatever that data is you will have to uh paste it up here and they you have to ask them can you give me your server name it could be just you know as simple as local host or it could be ad do xyz.com XYZ or represent might represent a company name all right and uh if you need all the rows from the table you choose this or if you have a specific query then you have to put the query like you know the SQL statements right um uh you will have all these uh um uh uh like uh L app you will have a like in service now you have rightly copy query right similarly in their database also they will have some queries so you could ask them uh ask them like you want to retrieve all the datas or just specific datas if specific datas could you please help me with the SQL query so they will give you the SQL query you do not have to worry anything about um you know how do I write this data these and all will be given by that server database team what you have to make sure is that you ask them for all these information you asked them for a username password server and the query and all of these data and what is this use last run data time is that um it works in a way that when you populate your last data time uh the records that were updated or inserted after that specific time for example um sore updated so as I told you any database for that matter is like a table only right so in their table also like in their database table also Imagine there is one field call sore updated and today morning we're running a schedule and it's retrieving all the data so so the last updated is today morning 6:00 and again today evening 6:00 is again taking another uh retrieval you don't want to take all the datas from last year today or lastday yesterday nothing you want to take the data that were updated either updated or inserted only since that last run what is my last run morning uh how do I which field can I relate to probably I can look at cisor updated field so if you want if you have such a requirement that you don't have to retrieve all the fields only the ret retrieve the data that have been updated or inserted um in the from the last run uh whenever my last run was happened after that were there any inserts or updates only that you have to retrieve then use this particular particular use last and date time and mention your field here this field is not the service now back in field instead it is the backend field of that this database right whichever table is there you have to ask them for that field fine and you have given the server inside the server you will have multiple databases right uh when I say database just translate in your mind as uh tables so you just put on the table name and uh uh it might have few databases might have both some might not have if there is any ask them for it and once this is retrieved what you need is you need to store that information in your import set table right so whatever is the import set table that you created you just put up your uh you know the label name and the back end name uh for example for uh this Excel mapping we created uh two uh uh two tables import set staging user import set incident right so so like that we will put the names of the service now table here that's all done and same like that you will have transform Maps uh okay import set table uh data is there and uh uh that will be stored in this table whatever you input here that needs to be transferred to the actual table of service now right main table as in as I told you UT set table is just staging table to store the data you know uh for a temporary time what is the main table that and all you will Define right that that things you will Define in your um transformation map and this data source you don't have to do it every time you can uh do a scheduled inputs I will show you the module called schedule inputs it is under system input sets there are some existing schedule inputs you know available uh I can show it from this example you just just have give have to give a name and give your uh data source name up here and it's not nothing you know difficult just similar to contr X let me check here okay it is it is showing you the datas whichever is active for now uh so you choose your uh data source and uh if you want to run it a system administrator leave it empty or if you want to run it against some specific user uh uh user profile you give their profile name and what is the schedule is it daily weekly monthly periodically and all of that and before this import uh before this uh uh entire uh you know data source thing could happen you want to do something that you can write it here uh if you uh if once this complete import is done if you want to do something that you can write it here this is similar to on after sorry on before sorry on start on complete in transform appap you have something called on start and on complete right so similar to that for schedule data input you have something called prescript and postcript right uh so coming with periodicity periodicity of scale eding you have daily weekly monthly um daily you give the time weekly is on which day of the week that you give it and of course the time of that and monthly is on which day like 10th of every month like that and periodically is like every um you know let's say 56 hours or every 3 hours starting with date we want this to be taken go live only on August 2 so even if it is active in the system it will not run only after this date is attained from there from this timing after this 8:30 it will take 3 hours and that time only it will run right so before running this you want to validate something probably you want this to run every 3 hours but not on weekends so you enable this conditional and here you will check you know you will validate your current day of the day what is the current day of my week is it a Saturday or Sunday if it's Saturday Sunday return return false else return true like that you can put your validations here right so now that I've explained you jdbc similarly with ldap also it's nothing difficult uh here you do not have a server you do not require credentials and all of that right but you have an ldap Target ldap uh abbrevation itself means light uh lightweight you know uh directory directory access protocol uh ldap is some uh you know you know technology or um a medium to import the data from active directory so in your company it doesn't matter you have integration or not every company will by default have an ldap integration So when you say ldap integration you don't think anything complex so in your interviews or in your future project somebody says you say you you've done anap integration it is not complex as the word integration might sound like just that it is about having a data source defined with proper ldap you definitions anding it and defining proper UT sets right so here uh it obviously asks me for input set table like where I want to store the data and uh it ask me for the input uh uh Target this is where all the data you know all the information is stored in I can um you know expand and show you what are the components does the lb Target contains right so as I told you similar to how we have um database query and all of that uh we have um uh you know distinguished name we have filter query all of that in active directory also for this queries and all you don't have to worry you just have to ask your ad team uh that hey can you just give me the distinguished name can you just give me the the filter query and what is the query field Sam account name is nothing but user name in service now what you have username right that is that is what is called as Sam account name in ad I will repeat username and service now is nothing but Sam account name and ID right and uh to which table this data has to go through so all these you will Define it here so this is what you have uh you know with these things any questions with the data sources and uh for data source we can only demo it for Excel we will not be able to you know demo it with uh uh a proper jdbc or ldap connection because we do not have that resources uh but it is as simple as it sounds actually you just have to uh get the query informations from the ad team and uh uh there is something called a test connection if uh your server details your details everything is correct in test connection you will say that test pass otherwise it'll say mid server fail and all of that okay it comes up with the error so usually if everything is fine it it will say that Contex connection passed you can try this in your company instance if in case if you are assigned as a role as a developer right if there isn't any question we'll take break from another 10 minutes and uh there are some components of the update sets that we've not explored yet uh so that I can teach it for you today for the rest of the session any questions so far I will just make an overview we've learned about data sources jdbc and Lup data source and Excel file data source and uh all the data drops into one section where is nothing but creating an input set table uh creating a transformation map and setting up of field mappings and utilization of scripts like on before on after on complete on forign insert and we have uh in field maping we have concepts of choice actions whether we want to create them insert uh reject um reject or ignore and again you can have options of multiple coiling and what else did we see yeah uh coil is case sensitive coil is empty fields and all of that right any questions overall you definitely give this try in your personal instance and any questions anytime just feel free to you know put me a message on WhatsApp I'll respond back to that for now any questions all right I'll go on mute and uh how about we have a 10 minutes break uh let me know if you require 5 minutes uh you know 5 minutes off screen time or uh just 10 minutes accordingly we'll take a call hello yes WESH can you check your WhatsApp group have you put on a message anything yes yes I didn't get the required result okay I'm checking wait okay so in that incident table spelling is wrong you have to put inci i d n and you should not put underscore l so it should be only incident right it should be just incident okay thank you so if I need to test this one can I one more thing one more thing so I think uh um uh you have to uh look you have to uh click on that advanced checkbox and whatever script you have to you have written you have to remove from this and put it in advanced script not with query with script and one more thing is the gs. print I demoed it to you because I wanted to show it in uh background script here what you have to do is current. add query of current do add query of CID current do uh wait okay no no current do add query of assign to um assign to I in comma uh inside quotes I in comma uh in line number 10 you have that assigned Capital to right that variable name you have to put it so there's a lot of directions required in this one okay I just need to make changes in 13th line right yes here there you have to put current. add query of assign to comma I in comma U again assigned to without space that variable name and that entire script you have to remove it and you have to put it inside Advanced script you using it in query with script right in screenshot if you see it says query with that script box says query with in so seems like you're using a query with script instead of that you have to put Advanced script and advanced script please enable the checkbox advanced at that time you will see a new script box opening up there you have to put the script not your oh okay got it so can I just copy and paste that entire script in Advan yes yes and along with that just uh bring in the new changes that I told you the incident table and line number 13 and everything yeah sure thank you yeah just take some 10 minutes break for your eyes uh uh it's been already 1 hour of uh screen time so we will connect back again at 9:25 right right now we're 914 so we'll connect back again 92324 925 make sure by 9:25 all there thank you thanks guys I will go on a break one question one question I check down Advanced I see two Fields apply to and query form where should I write the code okay you see applies to and query from okay okay then if that is the case this this one is correct here so I got confused with query from and query with okay this place is correct uh uh wut just that you change your incident table name and uh change your line number 13 it should work okay thank you all right thank you so everybody connect back at 9:25 thank you hey hi is everyone back by now all right I'm going to share my screen again right now that we have done with um data sources and import sets so the few components that we did not uh you know uh discuss the um update set so now that you know how to create an update set and all of that okay so let us say that as part of this update set development activity 1.0 July 99 right so we have only two customer updates meaning two changes captured in this so there is something that I missed it or either unknowingly um I switched from development to default update set and I created this there is two ways that I can bring that into this update set one is I can go to the specific record just keep a DOT like make some changes save it and then re reave it right so at that time it gets captured in my this updates it what is an other way to do is to uh you know utilize the customer update option yeah what I have to do is see if in default you see 754 records but in that this create to resolve duration is one specific customer update you want that to be captured in development activity 1.0 updates it but unknowingly you captured it in default as I told you either you can go to that record and recapture how is Let me refresh the screen so you can see that it is made as a current update set because you know no longer see a related link called make this as current to double confirm you can refresh your uh uh you know homepage there it will tell you right development so and so so it means that it is a current updates set so whichever you have uh you know take go to can go to that customer update record and you will see the customer updates in terms of XML and all of that in here beneath you have a field called updates set right so you just change it from default to what is your update set development activity right paste it up here right click save now you could see that this customer update component has jumped from there to here right so you mapped the connection from there to here now this is good what the other way we could do is let me switch it to default again only then I can show you the other way to do I'm reset setting it back to default now you will no longer see it here what is the other way you do is go to the customer update you have a link called show related records so when you click on your it will take you to the exact record whatever you've developed so you're not supposed to change anything in the script or change any of the field which might mess up otherwise you can make U utilization of the description or some comment Fields right so I can keep some dot here dot dot or you know the type something here because this is considered as a change in the configuration like I'm changing something but it is not harm harmful it is like harmless change so I have kept a dot dot here and uh before I save it I can show you that it is no longer available in development updates set so I'm going to save this whatever I did now even keeping a DOT is also change right so you could see that it gets captured in the update set this is what you call it as recapturing in the update set that you want so this is the update set that I want but anyhow I missed to uh develop a functionality in that update set but okay fine you need not recreate that functionality instead make sure you recapture that partic you know that particular record through keeping some dot or small changes a harmless change and using your current update set this is one thing and and um uh one way is the other way is as I told you open each one of the component and manually change the update set colum other way is in listed it also you can directly do meaning there is a related link right I do a right click open new window and here you see a column call updat set I can do a bulk change so I click on one of these I press shift and I press either up Arrow or down arrow I will put it under my development activity update set right now that I can see it gets six more 3 + 6 9 right this is one thing now um okay so let us say I um you have I have development update set and TST dev2 right there are five customer updates here you can choose to merge these two update sets and put it into one update set generally you will do a merge um when you do a merge what will happen is so let us say it has nine records it has five records so when you merge it it will become 9 plus F there will be one merged update set final update set it will have 9 + 5 uh 14 records but you can ask me what is the difference I can just you know in uh in I can go like this and instead change this into development right why should I do an option of merge what merge does is um okay let us say this is my metric definition right and I updated it 2 minutes ago let me open that again let me Mark this is a current update set this Dev V 2.0 right I will mark this as my current set and then I will go and few some more you know things in that so imagine this is developer one like uh um um you know Mr X who is in the development team and this is updated by this is created by Mr why who also in the development team this guy got a requirement this guy also got a requirement but coincidently both are around the same configuration right so the first guy got a requirement to change this one second guy got a requirement to change description let us imagine that what it gets six it gets six this is obviously nine only so when I filter down both the update sets contain same customer update right now imagine you are pushing this update set first you're pushing update this update set first to production what do you see expect in the production uh forget about all the records especially with specific to metric definition what do you expect you will see that it will be like this right it will be like this one and after that this was pushed after 10 minutes or 1 hour after 10 days this update set was pushed then in that you will see like this right which is fine but just imagine what happens as a Ulta somebody's pushing this update set so it'll be like this which is fine but after 2 days somebody's pushing this update set it will become like this right you understand what I'm trying to say let me know is not clear example to make understand better destion and one is trying to change script right okay um let us say uh this guy is trying to change the script okay and this guy tries to change the description okay now uh who did the first change is this guy only the script guy only did the first change so this guy updated it 10 minutes minutes ago this guy changed the descript in last two minutes so the recent update in that particular uh uh particular metric definition was done by this v2.0 guy only okay so imagine this update set never go goes into production this only goes that is fine because this guy's update set contains uh the updated script of the first person as well as the uh updated description of the second person correct clear clear with this point updated by person two okay this was updated by person one now update set One update set one goes to production means what will happen it will not capture the changes of person two it will only go uh with the script changes it will not have have description changes whereas update set of person two goes to production what will happen it will also contain the script updated by person one also updated by person two right you understand right when somebody's doing a change and you go to that Excel or you have this drive forms and all right in company also so one person is doing a change and after 10 minutes you do a change so it will say updated by you only but in fact uh it will also contain the updates of the person it will not override right but just imagine the Ulta scenario um this person's update set goes first so which is absolutely fine it's gets a short descript it gets a description it gets a script everything copied perfectly as expected but after two days the person's one gets scripts gets to production what will happen person's One customer update does not contain any changes of the description it contains only script so script will go to production just like that but what whatever this person two did it in description it will not be captured right it will be over written is that clear so these are some crucial times like where there will be mismatch of data when two people are working on same development even if it is a difference between fraction of 10 seconds or 10 minutes or 10 days doesn't matter the sequence of the update set should be very perfect now uh you in Sprint and all if you have vajira in your company you will know in Sprint and all people there will be 20 developers working on 100 updates set like that right each of them working on five updates set and every one month they will do a migration at that time just I understand the volume of the number of the update sets 100 update sets it is difficult to identify go to each and every record and see how uh you know um winavi and shushmita worked on on a same update set same customer update no it is difficult to identify then what is the best approach is to merge the update set right now you see that uh this one has got how many updates six updates and this one has got nine right 6 + 9 uh in which one of them is common one is common this is the scenario right now what you can do is you can take one any One update set just use the uh merge with another update set option so you give a fresh name to it like July 16 uh merged set set migration right so if you want to put some description you can put otherwise no problem here uh you have to put up a filter setting name is is one of name is one of development activity next line is Dev v2.0 right so you give the but you click on the button called merge are you sure you want to merge these two update sets you will not be able to undo the action I'm saying yes okay now let us jump into our merged updat set July 16th how many do you see you see 14 uh but technically uh what did we count it as 1 minute so in related list you can see what the merged update set so you can see that 9 + 6 what is 9 + 6 it's 15 right but you see only 14 here why why do you think so I'll repeat again we took our count before merging we saw that in one update said it was six and another update said it was N9 so 9 + 6 is 15 but in the M merged update set I'm I'm seeing only 14 this is because there was one common update set the system will intelligently recognize which one is the latest update whichever is the latest update available in both of the updates set only that will be taken right so in create to resolve duration you had two customer updates each one in one of the updates it took only the customer update which system considered it at slatest then what happened to the one that had a previous version it was just left as such in the old update set this is your update set one this is V2 2.0 is our updated set to right so the one and the 2.0 is the fresh uh recent update not fresh like recent update this one is comparatively to comparatively a older update so this was left in the uh left in the existing update set as such and what whatever is the latest has been here now moving this updates at merged one will you do you think will will cross a problem no it will not right because this one has a recent update only so this is not going to cause a problem so when you're handling with pushing multiple updates set or doing it as a batch as an admin or a developer whatever uh 99% of the companies uh make utilization of uh making this uh multi you know merging of the update sets is that clear right now there's something called parent right um so let us say this one I'm keeping parent as development activity for tsv 2.0 also I'm keeping the parent as this so how parent works is let me Mark it complete save do you see it no longer says it no longer says export updat set see if I complete this one what it will say it will say that okay here it no longer tells you export updates it whenever you know for a fact that whenever uh you mark a status complete it will by default say as uh export to XML right but here you can't see that and interestingly here you don't see export to XML instead you see a bigger word it's said it says export updat at batch to XML this means that this is a parent update set under this you have how many uh in this batch you have three child update sets in this batch right so whenever you take an example of One update set whichever has marked this as a parent every uh every other customer updates will be automatically stored in this update set this is the concept of having a parent mapping any doubt with uh why do we have a parent like I'll repeat again when you want to take an examl okay let us say this entire team is right now working on a workshop and uh um uh you know Jo be working on instant form layout uh um shushmita is working on um uh you know client scripts and Rahim is working on notification but everything is relevant to incident only so what I will do is I will create One update all of your 10 people or nine people update Set uh I will go to each one of the updat set and I will mark my update set as a parent parent parent now I need not wait a minute yeah I need not take an XML backup of every single of your update set instead that parent update set we created right I will take one uh backup of export updates at batch only that much and it will contain all the custom updates of it will contain all the customer updates of all of your work so this is basically to categorize stuff you understand the difference between uh having a parent and uh how the merging of updates set work right any questions with that regard for The Voice is not Audible um and I wasn't talking anything for last 5 seconds so I was asking if there is any question with the uh what I've told now no question all right for all right so um you need to understand what are the things that gets captured in updates set and what are not right so I told you any data data as in like in records the records does not get captured in it however uh the configurations like you change a component of a table like uh you change the dictionary entry label you write a client script write a business rule you write a notification um you change the maximum length of the dictionary entry all these gets captured right now how do we know uh uh you know how what are the things that gets captured and what are the things do not on a general context this is your understanding right the data does not get captured the configurations gets captured but let us say you have a require M you want some data also to be captured now how do you handle it in the system is for every table for every table you do a rightly configure at that time you see something like this right uh at that time uh you have to look for a particular uh column name every table will have one column which is always a column name Mt it is default it will be created by the system and the type of that column name Will collection so this is something that will contain all the attributes that you need in that we have one of the attributes that goes by the name update syncable as an attribute called update sync map to it it will be captured if not it will not be captured as simple as that right so uh I will show you an example now we have a proper update set so I will create an scheduled job scheduled job table is in fact does not have an uh um update Set uh you know put on for it I will look at any existing uh you know recent ones okay I'll I'll just take up some random stuff okay this is on a different application right so there is one script uh let me it is just inactive only that's fine but I'll just change it from daily to weekly uh so anybody should expect this update set to be captured in uh uh this update of mine should be captured in update set right in the asent happen the reason is because we do not have um update sync attribute put on the this table so let us say you have this requirement to change it what you can do is go to that specific table where updates are not getting captured do a rightly configure all so what are we doing you're doing it for the whole sum of scheduled script execution table so there you see a lot of uh dictionary entries you will have to focus onto the DI entry that says so you see three uh three is because uh this is the parent most stable S Auto is the parent most table under that you have metadata and S aut script excuse our requirement has to do only with CIS autoscript so I will choose this table wherein type is collection you can see that in attributes it says update sync is false right let me change this value to True okay I will put up my new attribute true and submit okay main main represents service now vender so they're saying that any updates in uh this thing cannot be updated by you unless done by main main means service now vender so we have tried to add uh update sync custom to this let us see if this works otherwise what we might have to do is we have to delete this existing record through a background script and after that we will anyways have our updates in custom added to this so that going forward schedule job changes would be captured in the updates it so I'm changing this to again on demand okay doing it save okay so now you could say that it gets captured in the updates you understand the difference right so let us say for user table user table is a data table typically it should not be captured in the update set and it is not encouraged but you have a special requirement that no no whatever things is there it should be captured in the update set then you have to do a right click on that table configure go to that collection dictionary entry and in the attribute uh choose upon a new attribute called update sync custom adding that we'll make sure that that table becomes um becomes capturable by an update set so that is how you uh you know uh make this thing happen any any clarifications or questions one show instant table example incident table is uh okay incident table data is not uh capturable but whatever configuration you do is capturable uh so I go to instant. list take me to a list of incident records but whatever you do you would undo it why I'm saying undo is every time you create an update you know you create an uh incident insert or every single update will be captured in the update set which is not right isn't it but just for demo let's do that not a problem I do a configure rightly configure and all okay so here you filter down to the one that says collection you could see task and incident reason is because we are an incident table however incident is iner from task so we want the stages to be done only for incident table so let's open up this record and in attributes let us add a new attribute update sync custom okay and value is true save it now um I can just go and update any of my incident Asen um I'll just change the short description of this save this up incident in collection update syn custom to okay looks like another uh you know restriction system does not allows you specifically for data related tables as in an incident or change table so I'm trying to add a new attribute similar to how I did it in similar to how I did it in my uh schedule job table right but even though I try to add multiple times it doesn't get stored there let me check one more time okay so the last captured update of mine is only on on the auto script a job table it doesn't get to anywhere else so I can do a reverse of this and show it to you again so I'm doing a you know updat set this particular attribute false and saving it now if I make any changes to my schedule job it is back to the original version like it will not longer be captured in an update set so in order to make this capturable in an update set we will have to make sure we have an attribute called updat sync custom and set the value to True getting back to your question uh it looks like there's another uh you know instuction from the system uh that system is very well aware and uh not allowing uh incidence and other important Big Data data collection tables uh not syncable even though when we try to push attribute clear any queries and finally I have this backout uh I know backout section which I need to explain in update sets let me take you to any one of the existing update set that we have okay you have the update set called July 16 merged which is nothing but merger of Two update set and it's got 14 customer updates so you moved to production and in production you feel oh like we have messed up we want to undo whatever we want right back out they call it like undo as in back out so if you want to back out all your configurations you click on the button back out uh 70% of the time it only results in a failure due to some reasons but 30% of the time it gives you successful result as in it properly backs out everything so let us try to back out in personal instance let's see what it comes up with yeah so as I told you there's are always a problem uh when we try to back out so it says there a problem deducted and um it says that there was one specific uh okay we were trying to change the related uh uh list right so that related list configurations is also captured in this update set they're saying that after this update set is committed there were several other update sets or default update set whatsoever due to which the same records were updated so it's giving us that clue so we are saying that um so we giving one of these answers no no keep whatever I have given now or use the previous ones or uh choose the ones that is in future so we'll say use the one that is that is already in previous because the current ones I want to you know back out H so so we have already given a decision to the system that for this particular error uh we want to use the previous so uh anyways it it it will be successful in uh backing out other 13 customer updates let it let it uh reload now you could see that that that update set itself gets out of the system it will no longer be available in the system you remember we created something called July 16 you no longer see that update set in the update set list right you see only development activity V 2.0 3.0 this is the one that I was saying that it got hidden right like it got vanished because this entire thing itself got deleted because we did a back out why am I seeing it here is because this is not a refreshed form if I try to duplicate this tab it will say no record form right right so earlier why it was unable to back out uh it told one eror that that update set was containing four 14 C among that 14 one of the customer update is about we were changing related list remember in incident we were adding metrics related list and all like we do cly configure related list and add things to the right and left and all so system is saying that um okay this update set is not the latest we have many more update sets which has the update to this particular record right this is system is saying that this is not the latest version for that specific customer update you have one more version in the other update set now tell me what you want me to do is asking us like tell me what you want me to do so we said oh keep the previous version there were four option given to us we'll have to say either keep previous version or keep current version or keep Target version so we decided and we gave instruction to the system stating keep previous version and after that we again retriggered the job of backing out and at that time it went from 1 to 100 like you saw that processing bar right and it was finally backed out now whatever changes in this instance that I had done as part of that um as part of that specific update set you will no longer be able to see in the system it all got wiped off like reverted in other language you can see it got reverted back to whatever the previous version was I'll tell you what is the use case of this backout you will use in your companies um there could have been updates at mooved to production it would have contained 100 customer updates or something anyways you have a customer uh sorry XML backup of that update set but uh there is a p one going on and it has been identified that due to some changes done by the update set it could be one of those 100 100 records right 100 customer updates there is a P1 P1 as in that incident form itself is not visible for the entire Global users when form itself is not visible for enter Global user it is a P1 right um something a very critical happened and uh you were given like 20 minutes of time 30 minutes of time and still you could not find it so the best solution to this is back out that updates it back up the entire batch let it be as as such whatever it was 1 hour preor and it doesn't mean that all our work has been destroyed our work is still in the XML backup right we have already done take an XML backup it is there we can redeploy this update set in another instance and like a stage instance or a pre-production instance there we can use it like a POC to you know casually sit in 1 hour and see oh which has gone wrong identify that component fix it and then take it to production because production is not a place to debug and just wait and watch oh if I change this is it working if I change this working right if there is a mess the management tells you hey back out everything let's do it again so we will back out it doesn't mean that your work is lost or anything anyways you have have your uh exported XML of your work uh which is obviously available in your development test instance also in your computer laptop right which you took a local XML backup so these are the scenarios where you would use this concept of backing up update sets uh um you know as a bulk or a single component of update sets any questions not regarding this I have sent you anage can you please explain what should be written in 13th line okay Asen have you sent in WhatsApp yes okay I I will yeah I will um take some five minutes break after the session and probably look at your message and WhatsApp and answer to that okay I'll either put a voice message or something in WhatsApp shouldn't be a problem all right guys anything else for on based on today's session all right so if that is the case just you know uh please try and do some exercises around this and if there is any question just put me a WhatsApp message I'll try to see how better I can so till now we have completed otherwise you still have tomorrow session right yeah we are on Friday so next two days is uh uh we do not have any classes unless and until if you're interested and want anything but anyways we are taking two our sessions right so we don't want weekend sessions so next two days spend time time on uh uh practicing what we've learned on all these 14 chapters with that we will U you know on July 19th we'll continue thank you guys thank you everyone for joining in happy weekend bye take care bye bye everyone so I hope all yeah all right so uh we have a concept called service catalog items which is uh you know um from Indus a perspective that is the only major item that people get access to right we have uh several different types of users and service now developers and it people who work on tickets the other people who just raise request right so for people who raise request they called end users and for them the primary role is uh service catalog right uh so the primary requirement is they would see a bunch of catalog items like when I say catalog items it is nothing like when you go to a restaurant you're being given a menu card right so you you can choose which kind of foods you want to order so similar to that in this IT industry like what kind of request you have I I mean it could be an issue or it could be a real request like you could request for a gadget you could request for laptop or um you know you could request for any of the softwares that you have in your organization so all of these will be stored in a a bigger box called catalogs so in lift navigation under Self Service I have something called service catalog so the hint right when I over it says the hint as request something so as the name suggests so this entire catalog contains of several categories so whatever is the bigger box you know you see that those are called categories and inside each categories you would have uh multiple catalog items so I opened up a category called Hardware in a new tab so it gives me a oneliner understanding of what is a hardware category and under Hardware category whatever items that I have everything gets uh you know available here I almost see some 10 catalog items mapped to here you can have more than 10 as well right accordingly you have another uh category called software when I open up that it will again contain multiple catalog inside that and you can choose one among the catalogs that you want so all these I'm explaining is in terms of end user perspective so I'll explain how you access in a catalog in terms of end user after that I'll tell you how do we develop one similar to this right and somebody is having difficulty to find you know what I want from this because they find oh this lot of categories is little confusing so they can obviously use this uh you know search catalog option so if they choose laptop it will uh you know search across the different categories so here you could see that this laptop keyword was found in service catalog and one under can we help you category and there's a category called peripherals under peripherals there were three items found under office there were one item found and under Services three and under Hardware there were eight items found all of them like you know 8 + 3 + 1 + 3 + 1 all of them in total 16 everything comes up here right so it is easier to find it that way as well otherwise you could jump into each one of the categories and look at the items inside and check as well this is uh looking at the data from native interface interface right this is what you call it as native interface a lot of people have access to something called portal so in url if you see instan name.com or all of that ends with SP so this is what uh you know the primarily the end users have access to and here also if you see you have an option called catalog on the top or else you could use this request something if you see both are nothing but the same just that they give you two options either click from the bottom or click from the top right now uh otherwise you could use this option also like how you use the global search in the native interface likewise in Portal also you have this interface so when you search among this it not not only searches across the catalog items there are knowledge based articles also right so it shows up both like it shows a list of uh articles that are uh in KB and it also shows up the list of cataloges uh that has the keyword laptop so everything gets displayed and you could use this and all of that right these are the two different interface so SP is the common portal we have in the system but how do inst let us say you don't know the URL and how do you go through is in left navigation you have to type portal so you have something called service portal home and if you click here it will take you to the default portal so like this in your instance you might have multiple portals if you want to know which are the portals that you have in your system in under service portal you have something called portals right so you go up here and system tells you that these are the portals you have but if you see there's a different color here alone right which means that this is the default portal right so let us say we want to see a portal called um KB portal right so what we have to do is just after.com SL put it as KB so it takes you to a portal called KB portal you could see that the interface is complet completely different isn't it so like this service now would have created multiple portals like this we can create our own portals also and I found something called ISC instant security Center so um I have to find what is the URL suffix of my portal and just change the link of that so there's some uh you know there's some functionality called uh uh to in inside of service now like uh we can these are something outter box right we can build our own tours also so if I click on begin tour uh it will tell me okay what this is for what is this is what this is and all of that right so it says what is session management and all of that so you have multiple portals like this and you can uh try and see oh what this portal is what this portal and all of that now getting back to the original topic service catalog so as an end user now you know you know how does the catalog looks like right let me open one of the catalog items right so in this box what are the things you have you have title of your catalog item you have short description of your catalog item you have long description of your catalog item you have a image of your catalog item right and afterwards you have some fields to fill in like how you have an uh uh a Google uh form to fill it up like that you have some fields to fill in um so like for example there is a label called optional software and there it asks you okay what is your optional software um you know adob Photoshop and all of that you could select multiple also and there is a label called additional uh there's a question you know multi multi-line question I'm saying multi-line because this text is you know bigger you could expand this as you enter the key uh you know Enter key button so this is a multi-line text with a label as additional software requirements and you have a field uh you know you have place to have attachments added and here uh it is defined the price in a particular currency and you have the delivery time uh time how many days uh it will take approximately for you to receive this product and how many such products you want so you could choose from here and I can just put it in add to cart uh if I chose to you know select multiple items and give one order so let us say I want to you know uh it's like how you do your online shopping right you add everything to the cart and finally give one order now if you want to do like that Choose Or add to card otherwise if you want to directly order just click on order now now that I have added this item to the card but not really checked out so it stays on my card right so let us say I'm a manager of a team and and I have some fire new resources coming into my team so I've got uh developer laptops for them so I want to choose uh uh I want to choose an iPhone for them as well right so again I'll choose five up here and I'll give add to cart now that uh you know things are added to cart so I I can click on this link or otherwise I can click on this thing as well now um it's similar to your uh you know online shopping here so you could directly you know uh but just before changing submitting your card items you could change things or you could remove things from the card and all of that and you see a total price how much it costed you so this thing we are not going to pay it or anything it just tells you how much it is going to cost to the cost center so if I have an option of no no this requester is somebody else I can choose the name and uh delivery information like uh number two XYZ Road you know if it is a specific delivery location I can give it and if there is any special instructions I can give it not appli mentioning so I give check out all right so it tells me uh when is the you know um uh when is the latest I could get this product 20th of July and this one is 23rd of July and you could see that the state says request approval right so you might wonder okay you know whose approval it's waiting for and this is the portal view uh where you do not have access to much of the details so you have to copy this and put it in your native interface you know as from developers perspective I'm seeing for end users this is well and good for them this is information is more than enough any anything uh uh what is the status anything they want to post it they can post it uh in the comment section but as a developer to understand it you know in a larger perspective I can take you to the native interviews uh searching with the same ritm number okay so here you see whatever options that you chosen it came comes up here and and your it generates an automatic uh ritm so you could see that you requested for five uh uh laptops five um phones right so you could see that uh there's an RQ which is the original request under which you have two RMS right uh one is for iPhone quantity fire the other one is for developer laptop quantity F and it has got an approval trigger to Mr Eric so so why it got an approval to Mr Eric is because who is Eric is so I'm looking at the workflow I don't know why it triggered to Eric so I'm looking at the workflow so uh at any point if you don't know what is the workflow there is always a thing called show workflow button so you'll have to click on the workflow oh okay so looks like there is a group called catalog request approvers group and this guy being member of that group uh is approval is right now requested I'm looking into his user profile now right so there is a group called catalog request approvers and if the cost is more than $1,000 it goes for the members of this group for an approval so this guy being a member of this group it has went to his approval so these are all our example catalogs already available in the system like this you could create your own catalog you could create your own workflow your own approval system and everything thing right any question so far with regard to what is a catalog and how it might work and all of that if that is clear we can next process into um how do we create one right so these are catalog items right so as a developer we're going to see how are we going to maintain these item right so as the explanation says the module is called maintain items maintain items so you go to maintain items so let's create a new catalog okay um order a workstation for home B desk right work desk for home so let us say this catalog item is require I mean uh facilitates the employees if they want to AV a work desk as in just the furniture just the furniture nothing gadgets or anything no laptops nothing if they want to request for furniture because everybody's right now working from home so they want to do not want to purchase it on their own they want to request it from the organization so they can uh use this catalog item okay and uh there's a lock here right so we have to it means that oh we have to fill in something so let us see what is inside there uh we have two types of catalogs one one is service catalog and the other one is technical catalog so since I activated a plug-in if you remember like uh you know two weeks back one week back I activated plugin called HR so this human resources and resources catalog also appears but um how I told you that there are different types of categories similarly you have different types of cataloges also so to give you an explanation so here you see service catalog right like this you have catalogs like HR catalogs you have catalogs like technical catalog and resource catalog so under service catalog only you have all these categories so if you ask me okay who will use the HR catalog is you have another portal called HR portal where people will use the HR catalog right so now this item is for um it users and we will map it to the service catalog only so once you enable this only after that you could see that the category options becomes editable right I'll remove this back you could see that category become grade out right because category is dependent on catalogs right because catalog is a uh you know bigger uh categorization and category is again a smaller categorization so as these two fields are inter independent only when you fill it up accordingly whatever categories are Ma to this catalog only they will show up here so I'll just put I'm looking for what is the category that I can have and I don't find anything called Home Office how about we create a new category called Home Office right so I can directly go here and click your new and I can give home office I'll give submit for now so you have an option to preview This Record let's open this record in a new tab and whatever you feel we have not filled it up let's fill it up okay all right and now short description um submit this request to order a Furniture work desk sure for your home description right and um I'll tell you pricing so we could uh even choose the currency that we want to mention so we'll put it as dollars and we'll put it as um $10 okay I will explain each one of them so I'm going to save this up so now that we have saved it up let us see what is the result of what we have worked now right work desk furniture for home right so what happened is I just you know entered one of the keywords of my name so uh and I searched upon it it could it could be visible here uh a shortcut to look at the item otherwise you General thing is people go to service catalog and there's something called Browse by categories you see something called Home Office right under this it's only one catalog so far that we have created so what you see you see the title shot description and the description we have given right and you could put up pictures uh disc so what I can do is I'm going to my catalog item and I'm inserting a picture here okay I'm clicking on okay and I'm going to save this up right so right click save so I'm refreshing the same catalog page I can see that the image comes up here right similarly you remember we created a category called Home Office so we could insert pictures here as well hold on did anybody join now all right the concern was I just got um you know voice over stating this conference will now be recorded so worried like you know uh we were recording past 30 minutes right let's see all right did somebody try to record just let me know that's okay if you try to record but I'm wondering like uh uh was it recorded you know all these time was it not recorded or not only to clarify yeah you started yeah it was recording it was recording from past 30 minutes okay so similar to how we kept an image for our catalog item we can keep an image image for our category as well and uh yeah so jumping into the item so now you see a short description description and you see the you know price and delivery date is is two days because I think it's default right now and we would still be able to change what is the delivery date we want to choose now we need to ask a couple of questions to the user right so how do we do that that will get you and there are few things like um hide attachment mandatory attachment and all of that right so you see a button called uh add to cut isn't it so if you want to hide that option option you could enable this and again if you want to hide this quantity option you could just check this up and again if you want to hide the deliver time you can check this up and uh there's an attachment clip auto box right you don't have to develop anything for yourself for this it will be already always available by default if you don't want to show this for a specific catalog item only then for this item you would have to make sure you enable this one so that the attachment clip gets hidden right similarly you have an option called add to wish list no wish list we do not have here if at all it was there you could enable this now um without having to write a script or anything you want to make sure that people ma mandator attaches an attachment like probably an approval copy from your manager or an approval email from your manager something like that so you could put a mandatory attachment checkbox you don't have to write script Nothing so I have done that you know the attachment is mandatory and I have done the card quantity and delivery term and all of that so I'm saving it and I'm refreshing my screen so you no longer see the quantity you no longer see that uh um add to cart and all of that options and you could see that there is a know Aster mark up up here and I'm trying to order it now so it says that attachments are not added right so you'll have to attach only only that it will take you to to the next page so that is the functionality of all of these surprising you could change picture right meta So Meta means for example right now when we did Furniture I just searched upon a keyword called furniture or if I search upon a keyword called desk also it will show me the reason is because it is part of your short description and it's part of your uh um uh long description now um if I put up a keyword called uh you know work from it doesn't shows up right but uh I wanted a native language also to be incorporated on search now it is difficult for me to put it on the description or short description or name right it will not look good so I can use the functionality of [Music] meta work from home comma what are the different options that I assume people could key in all the different combinations of word well these are the keywords I'm entering in my meta so when people you know uh Google it up as in like in this uh main uh Global search bar uh uh based on your meta that you have defined uh it will render you the results for had given a while and uh it came up in the search uh let me give this wfh again right okay so I'm giving this wfh again and it comes up here right so um there should be some keywords which you know that how people will be you know looking for this item using these these keywords but you but you don't want to put it in the short description and description and title and you don't want to you know look your catalog item little messed up so you could always use the use the option of meta what you have to do is you have to put all the keywords comma separated so whichever keyword you search it with it will come up there right so um the one option of looking into the you know item is like this and also you have a button called try it so if you click on try it it will take you to this page native interface uh accessing the catalog item now coming back to the point of how do we enter questions to this right so if you scroll down there are multiple related list so this is where all your development actually starts with so have something called variables UI policies client scripts and all of that right so the UI policies and the client scripts uh uh the UI policies that you have learned in uh uh your uh tables right while developing tables it will help you here as well now let me show you what is a variable um if you remember for iPhone we chose a few questions like uh description uh and all of that right those are called variables let us say we're going to give a okay under variables I'm clicking on new okay I'll open up in a new tab as well the list good night some I'm going ahead and clicking on new variable now that there are several types of variables that I can choose from one is single line text you remember for dictionary entry we used to give it a string or number integer reference and all like that here also you have um you have several options like a single line text reference right so each one of them has a different meaning for now to start with i I will give it a single line text and I'll choose the order question is um I'll give this a multi-line text because single line text people can enter only one line of uh answers M multi-line text they can like write it in paragraph also right so the moment you enter your question and you keep your cursor somewhere off the screen uh the back end name of the variables gets populated and everything turns into smaller case and whatever the space gets you know translated into an underscore so you could if you want you can just use this or else you could re rename this to some smaller text because you know uh when you keep a bigger text it's always difficult to uh bring that into script or something so the previous one is also good it it is a working thing only but if you have a smaller variable name it is even more easier right so we'll keep it like this and um we will save this up and refresh how it got reflected in your catalog item right says Please provide justification for the workstation requirement so you could keep on you know entering uh text here so let's make it mandatory and U let us give her uh this is something called annotation right so I'll enable show help and uh um click here to get more info please explain in detail why it is necessary for you to get the um f desk furniture otherwise your request might be rejected as well okay saving this up I'll refresh this now right so since I made this mandatory enabled I could see that this asri has come up and without filling this I will not be able to proceed on so it will say that some fields are incomplete right for example this field so I have to fill this up and the help test right in annotation I had given the help tags it comes up here and if you hold on to the question mark it says tells you click here to get more info it is nothing but the text that I entered here I can keep it whatever I want to and if I click here it gives me this text please explain in detail all of that right so this is the help text but if you want the help text to be like you know in an HTML format you could use this option um search to know more so in search I'll just insert a link do google.com Okay uh um so since it is not just a text I want to in help text also I want to embed in hyperlink or something and I want to bring something fancy I'm using the instructions option uh instructions and help text are nothing but one and the same the same purpose but the way it is rendered is different it this one renders like a plain text this one is like hello hello yes please tell me how did you get how did we get how did you how did we put uh link URL link okay I'll remove this so I'll say click here to know more okay so this uh here is the word right I let us say I want to embed it with an hyperlink so I am uh you know uh filling this up and you have bold italic and all of these uh uh the HTML options that you could use right and here you have something called insert or edit link so you click up on insert or edit link so here I will give uh a link that I have it could be a internal link a service now link or some to a SharePoint database or to uh you know some other web link doesn't matter google.com and that link will be uh put on the word called here right because I've highlighted here ear here now uh do I want this to be opening up uh you know on the same frame or on the top of the frame and all of that I can choose it here so it's always recommended to put new window blank reason is because if you click here the D direction will link will take you to a new page it will not mess up the current page that you are in right so uh it's always preferable to put it here but again it depends on your requirement if they want this to be a redirection link and they don't want the people to come back to the same form again you will have to put self frame or you'll leave it as none so that it opens up on the same tab otherwise this one opens in the second tab now I give okay I'm going to save this up right so you could see that it it it comes up like a similar one but just that you have an extra functionality of the IP Link can so I'm clicking up here it took me to this place right so it takes me to an hyperlink now since I gave it as ww.google.com it took me me to you know servers now instance slash something like that but if I had given it as like https uh you know if I gave it like this it would have directly directly taken me to this page only and there's something called Always expanded right let me enable this save this for you and reload and show you what happens is you don't have to click on this uh question mark icon to see this text message it gets expanded by default because we have enabled always expanded checkbox so if you see I just reloaded right I do not have to click on that question mark when the form loads itself it default gets expanded if I click back it shrinks and if I click back it expands but the point is once you you know enable this what happens is this specific variable alone uh the help text shows by default you don't have to you know take an extra effort to click it so you can keep it like that as well okay so this is a free text right um so if you want to fill out fill it up with some default value like uh remove the text and enter your values here right like I can if I give it like this this box will be pre filled with that data right so I can put it up like uh my justification behind the requirement is one two three like it's kind of a template that will be easier for people to fill it up instead of them writing all these descriptive words so you fill it up few things for them and they will continue to fill it up from further from them right so if I see a form like this what I'll do um I'm on work from home past one year and will continue to be and will continue to be um my uh my work role requires like that I'll give my list of justifications towards this requirement right now I have created successfully one variable so you go ahead and proceed multiple variables like this let us see some of variables of a different method um I'm on to my catalog item again if I you know scroll down I see something called variables the one that I just created I can open this up in a new tab and I can click on new to create new variable request on behalf of right I will just uh uh change this variable to a smaller text I don't like the bigger one that that's reason so behalf of means like we going to input a username right username means you have a table called cisor user where all the existing users of the organizations datas are filled in up so I'll put this as reference and um and type specification becomes mandatory right because if you're referring to which table are you referring to that is important cisor user right and then uh from cisor user table you have multiple records like uh you have users which are inactive you have users uh uh whose location is uh you know from let us say from different different regions also but let's say for this requirement let is assume this is only for India users assume okay so um we will put it as location not location but location. country is India right so if I type location I can't see something called country what do I do now right not country code there is a field called country itself how do I do now now what do I do is I type saying I mean focus on this carefully I type show related list right so the moment I click on this my related list Concepts gets enabled for this filter now I proceed to type uh location and I can see when I type I don't just see location I also see location uh and an arrow Mark right which means I can further do what do walking so I go inside of my location field now I have gone inside so I will click again I will search what I want do you see now I see country previously I wasn't seeing country previously I was see what country code but now I see country location. country is India okay so it's going to list down list of users who are uh whose location is mapped to the country India only those users names will be listed out here and um you could also you know enable up a filter saying Act active is true meaning list of only active users and email ID is not empty right done I think these are good um I'll save this up now I don't think you will see anywhere in this place the reason is because we do not have any users whose location is map to India so let us set the data correct so that you know it serves the purpose activist true email ID is not empty location will push it to the right and see what are the different locations that we have in the system already okay lot of the locations are empty [Music] okay I'm going to a cmn location table I'm putting URL set is equal to minus one so it takes me to a new record so the other this is a shortcut to access the new record of location but the other long method is type locations in the left navigation go here and click on the new button both will take you to the same page only right now I'll putad and I'll put the country as India okay save it I'll choose another location um chenai India insert and say I did insert and stay if you noticed it right so know I've mentioned four cities as uh location names all of them are mapped to one country called India so now what do we do is right so I have three people in my database who are all coming under the country India now if I look upon to this database I will be able to see this three people only right so now you understand what is the point of this thing um okay so let us say we want this catalog item to be seen only by the people who are mapped to India location then what we have to do is now we had show I mean I had shown you how do we show down list down the users uh you know having uh um uh having locations country as India only their names to be listed out but imagine you have a catalog item that catalog item is exclusively meant for Indian location users you don't want this to be available for an user for example I'm a system administrator right look at my profile and I belong to the location I'm right doing right click and switching to default view to see what is my location and where is my location field okay my location is empty um so I could choose one of these locations but let us say you know I want to um um I want my item to be visible only for uh India location user not just Chennai Bangalore or Delhi but any place that is mapped to the country called uh India or else I can restrict it to location wise also like the countryes uh sorry the city wise also so how do I do that is there's an option called available for right so you go to this available for new one India users just give a name like this so all these is you call it as user criterias and our restriction is not based on companies or departments or groups or anything but just based on locations right so we will list down the list of locations we have oh there was already few uh you know created by the system like hyat Telangana and all of that fine then okay there's two H buts one is the one that I created the others uh the system created anyways everything is mapped to the same country no no difference so I'll just fill this up so now if you impersonate somebody else who do not belong to this location they will not be able to have access to this catalog item this is how it works for so this way you could restrict who can see and who cannot see so when I have given available for only these people will be able to see but let us say I have a requirement like I can I mean I have a requirement that anybody can see except for a specific company users or specific Department users or a specific location or region like whatever options you just saw right now isn't it so if you have such a requirement you could Define it in the not available for right all right so now we have seen a single line text uh sorry a multi-line text and then reference variable and and uh okay I'm going to create an another variable with a different uh uh type of the variable as there is something called list collector um in watch list if you see you could choose multiple people right like that in catalog item also you have something called list collector so how I choose the referencing table like that for list collector also I have to choose the referencing table so here I will give um here I can give an filter like um um request that's RM numbers list so this time I did not change it I mean the one that was already created itself seem to be in smaller so I just left it as such so I will leave it as such so let me refresh it now you could see this you know RM numbers list right so I could choose numbers from here so it is not just meant for numbers instead of uh keeping this list collector I can keep it you know I can choose the referencing uh table as user table I can use it as Loc table or I can use it any table I want so the difference between reference and list collector is that here I have an option to choose multiple uh Records so this is the purpose of the uh reference uh you know the list collector in uh besides your reference and here okay I will tell you each one of them this one is an attachment is you have an attachment clip all together right but let us say for a specific variable like you have different different attachments for example uh let us say it's an onboarding uh this one is a onboarding catalog so you have to put your 10th 10th certificates here 12th grade certificates uh degree certificates everything separately separately not like one thing and where you multiple multiple attachments to One Clip no you have to attach your Clips here your here separately at that time you could create multiple variables each one saying attachment attachment now break is nothing but it will develop a underline between it is not a functional or anything it is just to look you know look good and checkbox is uh it will have a checkbox feel only that much like a true or false you have to give like you check it it means true you uncheck it it means false I will come back to this containers last this date is it will be a variable with this any label that you give but it will be a date field like you can feed feed in dates inside that and date and time is you can feed date and time inside that duration is something uh you will have a big uh you know box with uh cuts on it like you will have option to put hours minutes and seconds email is again you have to put a that field I mean the difference between email and single line text is single line text you can draft anything but in email you have to put proper.com like that you know finish up with doom or doin or any domain name so system has a backend validation to identify is it proper email or not HTML you know and IP address is also like that single line text label is just a label it does not have anything to feed in list collector is what you saw just now and you have uh masked and all of these right so I can show you few you know unique examples uh but as part of your exercise you could look at each of these variable options and uh you know work on them for now we'll take up a break and right now it's 95 right let's again connect at 95 15 right we'll take a 10 minutes break and we'll connect back at 9:15 so in the meantime you uh you know you take some break and if there is any question with anything that we've learned so far just let me know at 9:15 we'll cover that up and then we will continue our learning session all right I'll go on mute but the recording will still uh you know be on uh we'll wait for some 30 seconds and uh for other people to join and get started any questions with what we've learned so far all right so um here in this work desk uh all these items are listed out right uh you have a field called default value like U I told you what how does a default value Works in terms of a free text right but how do we put something like a reference to put it as a reference you remember uh I was telling you whenever there's something a reference field or a list collector so the reference represents the Society of the record right for example here's my profile and if I copy S ID this is the default value for example if I want to you know populate this request on behalf of with my record I should not put it as system administrator because my name is system administrator I should not put it like that instead I should put the CID of my record so I'm going to save this up so you could see that the next time I reloaded the form it gets populated with the um uh with my name so what do you understand from this is whenever a field is a free text or you know a text field you could just put in names but when it is a reference field you have to identify the reference referencing record and find its set in this case I want this to be autop populated with system administrator always so I do a right click and copy S ID or else I can find the Sid from the URL as well and put my C ID as the default value right these are the requirements when this uh default values are static what if it's dynamic as in whenever somebody looks into the form whenever from India location users when they look into the form their name needs to be populated here let us say if this that is my requirement now how do I put this here is whenever you say it's Dynamic here is a little of scripting that is in so whatever script that we use here is Javascript right so you say that how it's a JavaScript and then you put it like GS GS means Glide system in my system get my user so gs. get user ID will make sure that it gets populated with the logged in person's name okay now that I had refreshed my name gets populated here right so I'm going to impersonate somebody else like I'll impersonate other um another India location user what are the other India location user we mentioned we mentioned okay oh spelling is incorrect I kept it like this okay so I'm trying to impersonate wavi so I will refresh the screen so it gets reflected with the name vnav right so it is dynamic like whoever is right now the login person name their name comes up so this is happening because I'm not putting a static you know exact words instead I'm saying uh you know use the Java Script Glide system from the system over is the logged in user get user ID so accordingly it gets populated so here is a little of scripting to start with and yeah so now you have one two three three variables right so let us say I want this request on behalf of to be the last variable so I need to identify what are the other variables so whichever you keep give a you know lesser number like if this is 100 this is 120 and 160 this will come in the last if you give this as 70 or 60 right the order number this will come in the topmost now for request on behalf of I will put it like some thousand something so which is obviously larger number than any of the ones that you have defined so what happens is when you refresh the screen this one gets jumped to the last variable so this is how you make sure that which one comes after which and you handle your you manage your sequences based on that right request on behalf of becomes the last one now let's go to the catalog item item again you remember when regard to variable types it was telling you that um this I will make it to 10 okay 10 and this is uh this I'll put it as 50 and 100 so now we have 20 50 and 100 I'll create a new variable and um okay this one is no longer see all these are self-explanatory or understandable right as much as I've told you but I'll explain you what is this container start and end right so give container start and uh start and I'll put an order of uh 10 which is the last you know which is sorry which is the very basic and initial so I'm telling the layout layout is two columns wide alternating sides okay I'll give it for now and you see how it gets reflected in your preview screen so I'm giving the instruction that two columns wi and alternating sides and I'm giving a save so now what will happen is you could see right two columns wide so I developed two columns wide and alternating sides we gave so what system did is first variable second variable and third variable right so instead of giving alternative sides if you give it as one side and then the other what will happen is this will come in the first R numbers on the second and the third one justification will come on the right like this you could play around with this and let us say these are three variables the system was easily able to divide divide by two put everything to the left and put the put first half to the left and put second half to the right fine but what you have like some six variables you want to to show you know four in the left and two in the right at that time you will Define a container split you are defining to the system where I want the exact cut to be made right so you can't say that I wanted exactly after justification like that you cannot say but you can say it based on your order number like um uh I if I put 60 right I'll do an insert in St what will happen is uh this split will happen exactly at order number 60 meaning I have a variable whose order number is 50 right so exactly after 50 the split will happen like that and here we have never defined container end uh but but inside one catalog let us say you have 50 variables and then you want to First keep first 10 variables as one container and just you know uh leave it for some time meaning sometime meaning uh next two or three variables should be normal like one after the other one below the other and again a set of 10 variables bunched in a container then you have right now multiple containers right so at that time it is important for you to Define container and as well all right so you're basically defining your layout like one box in that one box left and right left and right what I want all that but how do you define which one comes in the left and right is based on your orders and the definition that you give in your container start like uh there are options like alternating sides and uh one side and after the other right so based on the option you give there it changes accordingly that is with regard to these things and these labels are nothing much it will just give you label there's nothing to type in or anything right masked I'll show you what what is a masked variable enter Pass Key so let us see how it gets reflected [Music] here all right so I gave it as enter Pass Key and uh if you remember I gave this check box called use confirmation just because enabling this confirmation what happened is it created a new variable called reenter see we did not create any variable called re-enter right so since we gave enter confirmation like in uh while you do signing in signing up in any of your you know accounts sometimes it asks you to enter the password reenter the password right because you're setting up the password first time so it checks whether both are same so this use confirmation checkbox works like that and this use confirmation and use encryption Works only on the variable type called masked so whatever I I'm trying to enter 1 2 3 4 5 do you see it is like uh it is like a password thing um and again if I enter something else it will say it does not match so I have to enter the exact same thing here only then it will come up here now you might have some uh uh you might have some catalog items wherein the variables requir people to enter sensitive data at that time you will make sure you create a variable called masked and if you require something like they need to re-enter so that it's double sure that they what they entered is right you can enable this use confirmation now coming back to use encryption right so in any tool you see there are two things to it client side and server side right in my eyes in front of my eyes these are encrypted like I can't see it unless I click on this button show right but if there is something called list view forget about uh you know forget about uh this uh database server set and everything this list of view is there right if I could generate a report on these variables can I see the exact numbers 1 2 3 4 5 or I still want this to be shown as star star star that R requirement is there right so encrypting the values even in the database level you know when you're trying to access a form or a report or anything at that time you still want this to be encrypted then make sure you enable this use encryption checkbox this needs to be checked otherwise what will happen is here it will be you know sastic and all of that but if you try to generate reports on your variables or anything it will be coming as 1 2 35 whatever you entered that only will come up so in order to avoid that you could make sure that you enable use encryption so it's all comes under the requirement and the requirement is provided by the business analyst but as a developer with your experience you can tell them that hey we have this option we have that option right as a brainstorming session you could have with the business analyst and uh you could help in developing a requirement as well but ultimately the requirement comes from the business verticals and sometimes from the end users which is again reviewed by business and comes to our Q as for development and what are the other variable types we have all these are explanatory like s or no URL UI page UI Pages like U there will be already few pages available you just have to map it or you can create your own page so creating a own page requires a lot of scripting and stuff these requirements comes to you very rarely nothing worry for now but I'm telling you that uh when you choose an UI page you have to choose an UI page uh if you do not have an UI page already developed mapping your matching your requirement you have to develop one and keep it for now we've not jumped into that that much of scripting we will go face by face right right this look up multiple choice look up select box is nothing but same as your reference and list collector so um in reference you see it as a search right this one will come it as a drop down and this one is same as list collector same difference it is not a search it will come as a drop down so that is the difference between look up multiple choice and look up select box also you could Define like in reference and all um let us say if you're choosing reference and you could only reference it based on names right you can't uh you know enter email ID and search it whereas when uh in lookup you can Define which column you want to reference for example sore user and my referencing value I can put it as email right but generally if you remember reference we can type it only name because the display value of uh user table is name but here I'm saying that email is the thing that I want to check include none unique values instead of insert and stay instead of insert and stay I just gave right click save so what happened is uh your Enter key uh might have been uh okay so R is enter pass users and it comes with the list of all the users I have I have not defined any filter uh I have said I want to you know sort it out based on emails so in user table you have multiple user records in there you have email IDs right so their email ID gets reflected here so if I change this to look up uh um look up select box it will be like uh you know you have to pick from that it doesn't uh you know deliberately list down everything right away instead uh you have to look up from the database again you have a benefit of selecting based on the email IDs unlike the names imagine if I had kept it as a reference if I had kept it as reference what would have happened I would be seeing Abraham Lincoln admin system administrator I would not be seeing admin atth example.com right now in list lookup select box I have an uh privilege or option to look up based on one specific field that I want to right I can choose it as building or anything since I chosen it as based on email I'm seeing the list of email address yeah pretty much you know everything has been explained in terms of what are the different variable types we have and again uh if you remember uh you worked on this uh UI policies when with tables right how do you show an ey uh how do you make mandatory how do you make things read only uh onload checkbox reversals reverse the false exact same dto nothing difference the same you could make utilization in your catalog UI policies right and next comes is your catalog uh client scripts so to start with I will explain you what are the different types of catalog CLI scripts we have you remember I told you with regard to UI type UI mobile yeah this this has been already explained for this batch on uh UI policies class um so here you have an option of client script onload on change on submit like for example you want to do some validation when you submit a form then whatever script that you're going to write you will predefine it saying that hey it is a onsubmit client script and whatever scripts you want to run at the time of form loading you will choose it as onload again when a specific value is changed for example um I am changing you know these values I'm so if you want to evaluate few things at that time I can write that logic inside the script section so these are the different types of on change uh on uh you know CL uh on change onload and onsubmit client scripts you have and when you mention on change you have to tell on change of which variable right so it asks you which variable so you have to say that whenever somebody changes a variable called Pass Key at that time you want to validate now you could see three checkboxes saying catalog item view RM catalog task right so these variables appear in catalog item view right now that's what you call this catalog item view now the possibility that these variables could appear in your requested item also right requested item don't you see a requested item varable it appears so if you want that um uh if you want some scripting logic to be uh you know applied when the variables are visible in RM then you will enable this Logic for RM as well similarly once this RM is approved you will have something called catalog task generated and in your task also you will have variables so if you want your logic to be working upon catalog task also you will enable this one as well right and again um yeah so these are the different types of client scripts we have in tomorrow sessions we will explain in detail how do you write your client scripts but otherwise UI policies client scripts introduction you know and you know available for and not available for categories and cataloges coming back to variable sets variable sets are nothing but okay so let us say I have a VAR called request on behalf of right so I find this specific variable uh I feel that okay this specific variable could be used across multiple catalog items right um so instead of creating the same variable in every single catalog I can create it at one place and utilize it wherever I want right so let us say you have a requirement wherein there is going to be one common variable and there is a potential or possibility for that variable to be used across multiple catalog items for example justification request on behalf of these are very generic Fields right there's a possibility that you could reuse these uh variables at multiple places at that time instead of creating a variable and mapping it to a catalog item you could create a variable set and store all your uh uh you know all your uh um these kind of variables there and utilize them on each of the catalog items you want for example let us see what are the existing variable sets I have so for that I can click on edit meaning it's going to show up the list of variable sets that has been automatically created by the system I see some variable set called standard employee questions let me bring this let me bring this and I will refresh my form okay nice so I can see that um when I added that I could see there is a variable called who is this request for and a variable called when do you need this right so it tells me that there is a variable set called standard employee questions uh under that I have two variables one is requested for and uh under the one is needed by and it it has been included in multiple catalog items already it was used by five catalog items and now we are also using it right so when you have requirements such like you could reuse your variables at that time you could create a variable set like this and when you let us let us create a new variable set right there is a type called single row variable or multi- row variable single row variable is nothing but what I showed just now right single row they keep a name and all of that let us see what is a multi row and with this we'll wrap up for today and uh the scripting and everything we'll see up in detail tomorrow um so I give a name and automatically backend name is created on this so I'll create few variables like um name email and phone number single line text I'll put an order of 10 I'll put a name save this and you can see that the variable set it got mapped to is new user details right so these variables are not in the catalog items instead these are stored inside the variable sets name email I will do an insert in state so I'm creating a second variable for this variable set and I'm going to create a third variable everything I'm just using for testing I'll use it as single line text phone number phore insert [Music] St maintain items um what is our catalog work desk so I will jump into this variable set and here I can see that it was included in workus Furniture now let me refresh you could see the difference between multi-line text and single line uh sorry multi-line variable type and you know single row variable type so in multi- row variable type how does it appear is where is it let choose order as two so that it appears in the bottom a little I'll remove the uh existing variable set that I already have okay it isn't appearing I'm not sure why I will check back and rever again are these active yes this should be by Def default okay I'll check this back and you know probably we'll come back on the uh tomorrow session with the explanation of that but today what we have looked upon is how do we create a catalog item how do we create variables what is the uh use of a single row variable set we've not yet looked into multi row variable set but you remember I showed you the single row variable set and of course UI policy and what are the types of client scripts but not in detail and the accessibility options with regard to available for and not available for so this is what we have looked up in detail for today so uh you know you try this as a practice session today and uh let's connect back again tomorrow there we will continue part two of the catalog items right any questions so far all right guys I take that as a no and I will stop the recording to client script uh the same logic of client script that you write in catalog items applies to table as well the only thing that changes is where are you writing right whether you're writing to a catalog item then the client script validation and everything applies to a catalog item if you write it to a table then it applies to the table form so uh to be continuing with what we had yesterday so today we will see in detail of the client scripts so the entire session of today will con conate be concentrated only on the client script section so I go to maintain items uh from the list of catalog items I do Isa of updated uh uh field and I choose this catalog item and I go to the related list I find all of these variables uip policies and client scripts [Music] so here have my I have my catalog line scripts right so we will write one one example for each of the different types of CLI scripts CS CS represents client script here now when you put it as on load system automatically populates with a syntax it says that function on load and then whatever code you have to write you have to write inside of this particular function only and if you write any code without this function it will not work so because we are defining the client script when this client script has to work right so in there we are saying that we want this to be working only when the form loads uh Vin uh when I click on try it or when I access the catalog through service portal or any other method when the form load right the moment the form is rendered at that time you want to check something or you want to populate something so there you will uh use an onload client script now when I change it to an on change so you could see that you know it brings up a new syntax so let me uh you know let me uh walk you through what this syntax is first of all so on uh on the condition of form loading you don't have to worry like which field nothing like you're going to consider it completely on the entire form whereas on change of form Fields you have to tell the system which field is it right so here you will say that okay on change of justification details field on change of on behalf of field like that you have to Define it here and moreover if you look at the syntax so it tells you on change which is fine and this one is control right so uh you can use this control element like for example as you are typing as you're typing this field if there is some different characters identified or some special letters identified at that time so uh anything as and when you're typing you want to do something you will you make use of the element called control the other one is old value and new value right so let us say um you change the uh uh you change the uh uh uh description from hello to previously it was allow and then after some time you would remove it and you change it to test so here old value represents hello isn't it and your new value represents test so if you want to read the old value then old value if you want to read the new value you have to put new value right and this is loading parameter identifies whether the form is right now loading or not so what happens is what you have to keep in mind is client scripts run on form loading as well um as in even though you define it as onchange client script the onchange onchange client script also runs on onload also so to avoid that you need to put an extra parameter like this if the form is if the form is is loading written written means it will not proceed to whatever lines of code that we have after line number four it will stop right away right also sometimes you might have a requirement that um if the new value new value means like uh let us say it is test right now and after that I remove it it means that what is right now the new value the new value is empty right so if the new value is empty also system does not want to process anything so if you have a condition you can add this as well and in scripting this pipeline symbol represents this pipeline symbol right this represents R condition R condition this equal to 1 equal to represents setting of values double equal to represents validation you know you're validating something and right and is represented by double ENT right and let us say not equal to not equal to is represent by not equal to equal to is represented by dou equal to setting of assignation or setting of value is done by single equal to right so these are the basic stuff now let us create a new variable let us create a new variable called request type and then probably we'll uh you know introduce drop downs like none and um um personal request or team request so the name gets automatically populated order I'll put it like 30 I'll put this as select box select Box means like it's a static select box with drop down Fields so I will say include none right click save the moment I see save it and the form reloads in the related list I will be able to see options there's something called options wherein you can create your own options like you know the question choices so here I will say request for self uh front end name is request for self back end name I'll put it as self request for team team okay and this one I wanted to come first and this one I want to display again so I'll put it like 120 and finally give it a save right click save onload script okay so let's write an onload script and I'm choosing onload and let me give it as you know UI type is all so regardless of I access this catalog item from mobile phone or from Portal or from native the script is going to work for me so whatever script I'm planning to write I will write it only inside my C Braes if I write it outside my function it will not work right now so when the form loads I don't have to do any validation right because right now only the form is loading why do I have to do validation so probably I can give them an alert saying choose the correct request type which shall determine um the appropriate shall determine correct approvals so any alert message uh goes with the syntax alert parenthesis open quotes uh close quotes So this can be single quotes or double Cotes shouldn't be a problem so you could see that we have saved it I'm going to refresh this form so the moment the form loads it sells me alert choose the correct request by which sell determine blah blah blah right and I give okay now let us say I have a requirement like this form can be access anybody from India right but again there might be a uh thing like the form is being accessed by admins the uh I mean admins as in service adment people who have the role called admin and form is accessed by non-admins so I'm saying that if the form is accessed by admin um I'm going to give them a different alert if the form is accessed by somebody else who's not an admin I'm going to give them a different alert so with that being said um so I'm putting up a condition if Gore user right Gore user is one of the Glide API Glide form API uh with regards to user access like anything with regard to user access you want to find then in client script you will use Gore user so I'm putting up a script called Gore user do has Ro admin then I'll give them an alert saying admin identified no approvals required right else I'm going to show this alert so since I am ad me myself if I log in I'm going to see only uh line number six I will not see line number 10 so I was telling you that Gore has uh Gore user gets you all the uh all the user data elements right so um you have an element you know you have a method called get full name so what we will do is okay what do you think it will come here so why we put up a quotes is because those are static like string string proper text so that is why put we put it as quotes but if your alert message is going to have a combination of a dynamic value and static value then you will put something like this so here how it's going to print is system administrator is my display name right if you look at here my display name is system administrator so system administrator identified as admin hence no approval requir uh vun logs in and and as long as he's also an admin it will say vun identified as admin hence no approval required like that Let me refresh this form so it says that system administrator identified as admin hence no approval required so if you impersonate somebody else who does not have the role admin for them this will not say it will go into inside the else Loop for them this alert message will say okay so uh first name will give me the logged in person uh first name as in for me it's system and um uh the client data will be showing like you know the form values and the full name is nothing but what you saw now and role is the U uh any one specific role that is put inside the parameter role exactly is they have only that role nothing else like a person having only one role which is so and so that is I mean if you have such a validation then you will put has role exactly and if you have a list of Ro like approval admin change admin and itl user something some you know four to five bunch of roles and you want to determine if the logged in person has at least one of these roles then you would probably use has roles from list right and the last one has roles as roles is nothing but if that person has any role see if us a table it's not mandatory for somebody to has role right they can have role or cannot have role and cataloges are meant for everybody um so if somebody has at least one role then you will use the validation has roles and then user ID it will BR it will bring him the you know uh for me system administrator is the full name system is first name administrator is last name and the username is ADM n right so that that will be uh uh brought in as username and in user ID it will bring my CIS ID so these are the uh you know uh top list of user elements that you have so any any doubts with regard to this with this we will jump into onchain and on change you have further more uh where I can explain uh the other stuffs okay so I will just change to on uh this to on change remove this put it as on change okay I'm going to remove this so so ma'am G user like G hypen user is the default table default instance it is a Glide for yeah Glide is okay all these are apis uh meaning meaning like the library files that you can access inside of service now so Glide form is form right the word form it represents that you are in the client side and you're trying to access the fields of the client or the user object or in the client side you will not be able to put it uh gcore form anywhere in business rule or schedule jobs nowhere um and glide record is a serers side API so um in server side scripting as in background scripts or um or a scheduled job a business rule all these places you will use a Glide record and the U not just it is a different thing but it is also um see here you're trying to access one form field variables like that there you're trying to retrieve a table do some validations in table and try to update a table and all of that right okay so how many types of apis are there like in general like uh we do we do use uh regularly like okay so then there's more than you know 20 apis but on General you would use use being you will be using some five to six apis okay so what are among them one among those major two is Glide Glide records and we have something Glide agregate so all these will go in one after the other right now just focus on the Glide form right okay okay yeah so uh here you have your uh onload CLI script I have not deleted or changed it and here I have given insert and state so this is my onchange script so in my onchain script let us uh eval the on chain script on request type okay so if new value so uh you know in starting phase it might be difficult for you to uh remember that it is camel case and all of that you don't have to write this line by yourself this line is automatically populated by the system but it is important for you to understand what this line represents and means right so um as I told you uh when you do a request type right let us say I want to read the old value then I will put alert old my old value is plus plus means like a concatenation after that right so now if I save this you can identify that um I'm going to save this and reload this form anytime you change a client script make sure you reload the form only then your changes will be uh reflected back here now we have written non-change client script such that when we change the request type right okay so previously we changed it from empty to self right so it says old value is empty nothing and new value is self okay right and right now I'm changing from self to Team 1 minute actually um this old value object is supposed to take you your old value as in when you switch from self to team so self is considered as old value and team is considered as new value not sure why it's not reflecting uh but when you put it as am I putting it without any uh character isues all right so old value represents for example if you're changing from self to team so self is considered as old value and team is considered as new value so um you have a requirement that you know when somebody changes from self to team so saying that um let me put it like this if new value is equal to equal to what what did it say as equal to equal to means validation right equal to equal to team so I'm going to give them uh um right so I'm validating if the new value that they have chosen is mentioned as team so in form it will say that request for team but if you remember while creating a drop- down I kept it as a small you know backend value as the for request for self I kept the backend value ASF the reason is because those backend values are the values that will be used in scripting and all of that places if you write big big characters there it will be difficult right like I mean you have to put request for team here also so that is why the variable backends and the drop down backend everything we're trying to keep it short and unique so that it is easy to be uh called inside of your script record it right so uh whenever my on change request type uh on change of request type happens so the system is going to check if the new value is team if the new value is team it's going to print out an info message stating you might require extra approval so this is not an alert it is an info message right so it will say right in the form it will not ask you like an popup or anything so your will'll choose it as team so you could see that it gave us an info message in blue color that you might require extra approvals as this is for team right so this is what you call it as an info message so like this let me show you what are the other things we have so you just have to put Gore form Dot and leave it system is going to give you a lot of options uh you know uh you have in the system um like for example you want the CH you know you want to change the label to some red color some you know show uh not not the mandatory ASC but show it in a different fancy colors something you could use the option of add decoration and right now this message came in blue color right because we defined it as ADD info message instead of that if you gave it as ADD error message it will show it in red color instead of blue color it will show it in red color that is the only difference between ADD info message and message in right and then okay so this add option is there right what happens is when you give add option um so we are trying to add an option to a variable called requestor type comma the front endend name I'm going to give it as um uh not applicable comma back and name let me give it as n okay so let me save this and show you how it reflects back like this I'll try to you know um demo as much as uh um G API functions we have so that you understand okay what each one of them represents clear messages okay so the moment you write this line what happens is whatever messages that you have got in the previous no even 10 message one message it doesn't matter all the messages gets cleared out I want don't want to keep this because I can't if I keep this I will not be able to demo you the first two lines so for now I will come in this up okay so clear options is just uh you know just in uh uh opposite of add options whatever you try to add here it gets cleared up here clear value is like I'll tell you something so you have something called um get value get value of request type let me take the back in name of any other variables backend names are stored in a field called name right justification details Glide form dot set value of justification details okay so what we going to do is if Glide form. get value of request type equal to equal to self then forget whatever is in green color because green colors are commented lines so I'm writing a fresh script so I'm saying my system if my request type you know if I'm trying to get the value of request type if it is found as validated as self equal equal to represents validation right then I'm going to set my value of justification details as as request for self justification below like this okay else if team I'll put it as okay this is a this I can show you as a typical example with regard to okay messed up the semicolon right typical example I can show you to how do we utilize get value and set value any questions with regard to this uh these four lines so this get value helps you to get the form value of your request type and if it has been validated as self then you're going to set the value of your justification details field with this exact text okay and uh if that condition does not satisfied right this condition does not satisfied it will directly jump to line number 16 so in 16 we validating else if if my form's value of Rec field request type is evaluated equal to equal to is is equal to as team then I'm going to set my set set my form value field that goes by the name justification details with this text exactly request for team so and so so I'm going to save this up so anytime you make a change to your onchange client script or any client script make sure you reload the form only then the change gets uh reflected so I'm putting as request for self so you could see that the description gets Auto set with word called request for self testification below I'm again setting it to request for team so you could see that it gots reset to something else right so this is happening based on your client script so since we are right now handling with uh on change uh instead of accessing the form variables like get value of request type this on change variable type itself is for request type right so instead of putting Glide form. value you could could just use the word new value so I will replace Gore form. getet value of request type with new value right so new value is the method uh which is already stored with the value of your request type so here also I will put it like this so if I save this functional Dev device it's the same it will do the same thing for me right but how can we determine how can we determine that uh new value is like new value is mapping to this request type field okay while writing itself uh you you will know your requirement right I mean for me I'm going to evaluate the value of the request type at that time so instead of putting Gore form. getet value I would just put it as new value because anyways I know that this client script is going to work on change of request type and my requirement is also uh validating this request type so at that time I'm using the keyword new value otherwise let's say I'm going to evaluate some other field like um you know probably this uh on behalf of field or uh RM numbers list something like that then I will have to any always put Gore form. getet Val of on behalf Gore form. getet Val of um RM numbers like that since I'm trying to read the value of the read the value which is nothing but same as what is available in my current onchange client script then I can readily make use use of the existing package available the existing method called new value right so this keyword will be helpful for me actually we couldn't get I couldn't get that one okay so you're trying to understand when do we know that we can put new value when do we can uh when do we know that we can put glide. get value right is that your question okay now I'll put alert new value and save this imagine okay so right now this onchange client script where I'm I writing I'm writing on the change of the field request type isn't it so uh imagine I'm saving this form and U I'm reloading this and I'm changing this uh request type to self now what do you think you will get in your alert okay I'll can demot that to you um okay look variable X is equal to C form dot get value of request type okay variable Y is equal to this new value okay okay now I'll put up an alert message X is X okay and I'll put up an other other uh alert message Y is y so you know that X is request type and Y is new value right what do you think both are going to print it is going to print X is equal to self and this is going to print Y is equal to self it will show the same one that with that level are you clear let me save this so I'm putting it as self so it says X is self also Y is a self right but here in the script if you see X is nothing but GL form. get value off whereas Y is new value so it means that this slide form. get value of request type is same as new value the reason is because uh what is the key here is what is the value that you're trying to get you're trying to get the request type value which is nothing but the same uh variable that is used in this particular records client script right if I put it as you know justification details imagine I I put the variable name as just ification details here and I put it as request type here so this will tell me self or team whereas this is going to print me a bigger text let me save this before I could test it you just look at the script once so this change script will work only when I try to change my justification details right and in place of X I'm going to print my request type value in place of Y I'm I'm going to print my new value new value is nothing but the justification details value now it will walk on change of justification now you don't have to change this request if you change the request F nothing is going to happen why because my onchange client script is will work only when I change the justification details value so let me change this one okay anything I can just type something dummy and I will take my cursor off the screen see so you could see that X itself from where am I getting the X X is nothing but the value of the request type right and Y is justification whatever I print in my justification that comes up here so you understood right new value represents the value that I entered in this variable name and get value represents whatever variable name that I have kept it inside yes ma'am so for each able if you want to put some validations we need to write different client script or here we will be writing different okay uh so whenever justification field changes you want to do some validation and if whenever uh reest step field changes you want to do an another validation at that time you will write different different client script and there you will correctly put okay this client script is will work only when justification field changes and new client script you will write like oh this will work only when request type changes like that okay got it but let us say you have a requirement whenever request type changes uh at the same time uh request type has been changed to self now you want to evaluate two to other you know two to three other fields at that time uh in the same script only first you will evaluate your request type and if condition satisfi you will for go proceed to evaluate condition number two and three within it all depends on your requirement right yeah yes okay so this is with regard to on change and um um I will show you the onsubmit uh client script in on submit you do not have this option of uh you know new Value Old value right because that on submit client script shall work only when you click on the button called order now or add to cut so at that time what you want to do the validation uh generally you know they try to keep an confirm message are you sure you want to submit this request like that or else people give a validation that uh whether such a request is already available in my database right whether this person has already uh requested uh similar request in the past uh if so just AB their action something like that so all these will come under on submit client script but the same Glide form Gore form. getet Val Gore form. set Val will all be coming there as well right so um probably we will take a 10 minutes break and we'll connect at 9:00 so 9 to 10 uh I will show you one example covering up on change onload and on submit a full detailed one right is that fine yes also I have one more question yes please what is the difference between client script and business script and server script okay client use all three yes yeah client side business rules you call it so that is server site client script one of the examples of client site script and uh UI policy right UI policy is also a client side script business rules uh are server sites script scheduled job scripts those are server s side Scripts uh you have something called Script includes those are site script notification email scripts those are server side scripts right and see anything apart from client script and UI policies are server side scripts here because in client s side there's only two types of script one is client script and the other one is UI policy rest all are considered in server sides script so in client sides scripts you will use the API like Gore form um all these Gore form and Gore user get elements in server sites all other apis you will use it in server sites scripts like Glide records uh Glide aggregate there's something called Glide Aggregate and uh current and previous objects so all these you will use it in server s side scripts um don't worry about server side scripting it we'll finish see we have already done UI policy right once we finish up client script you will get a Clarity of what is client set then if I explain Ser side you will have a Clarity and to give it to you very short frame you are right now sitting on your laptop or your phone or desktop whatever and you are accessing a form and you're trying to do a validation based on what a input right now what I input right now right what is not being saved but what I input right now you want to do some validations through that then all this validation can be handled only in client side right because in UI policy on change of a specific field you're trying to make an another field M uh read only another field clearing out all these you're doing right so that is in front of your eyes when you're doing some form level changes in one form uh which is reflecting on an one field and which is reflecting on an other field so to give you that way it's in the short way so that is what you call it as client side uh actions right this does this help this explanation of you know uh what is a client side and what is a server side anything other than client side you just right now round it as server side all right then so we'll take a 10 minutes break and we'll again rejoin at uh 9:00 and from there we will continue with our CLI scripts this conference will now be [Music] recorded all right guys I hope everybody's back by now yeah so do we have everybody in the session right now uh the recording is on and uh screen sharing is on I believe so let us bring into a requirement that you know I'll remove all the ones that are existing available I'll put it as an onchain script whenever okay so here is my requirement let me write it down first and then we will see how do we conver convert that into the script so uh when request type changes check if uh request is for self if self uh check if if uh request already raised for same person mentioned on on behalf if so alert and abort submission in the past 6 months okay this is the request step right so let us say um you know uh you have a catalog item called work desk for furniture and what if people raises multiple request there has to be a systematic design such that people do not uh request for multiple you know workstations right uh because uh in big organizations there might be some approval gaps or something so people would like you know approve it like anything so it it should not be the case we have to make sure that the same request was not raised by them uh in the recent past 6 months or one year or any time in the recent so like that we need to keep validation lets assume anybody have questions with the requirement once again explain about the requirement okay so uh whenever somebody fills up the form let us say um I'm filling it up for Mr abil tutor okay okay so let us say I'm filling it up for lock Mei um uh and then I'm choosing request uh for self so if I choose it as request for team no validation required but if I choose it as request for self now my system is going to check do I have any past request in name of Lakshmi uh for this particular catalog item right for the same catalog item for the same person lxmi were there any completed or impro tickets in the past if so system is not going to allow me it's going to say Hey you have already raised request for uh walk desk Furniture so you will not be allowed to raise a request for one more one more furniture right is that clear okay all right so whenever request type changes we going to Che first check is whether it is for self or team if it is for team understood like I might raise a request for some four other team members that is different but if I'm raising it for a specific this person then I will choose it as self right so I'll check if new value why I'm giving new value here instead of get Glide form get value of because anyways the value I'm going to check here is request type uh so I'm using new value in of this if you want I can use it as Glide form. get value of request type as well get value of request type is equal to equal to self then validate if duplicate account right now how do I know that whether somebody has raised a request already or not so let me submit a case and show it for you so everything is stored in a table called item. list which in other means called as requested item tables if you look at requested item tables also you will get the data right requested item but I'm always trying to emphasize on the backend table name because that is what will be useful as a developer uh till now we have not even submitted any one request also so we'll go ahead and submit few request for this one oh we changed this uh this thing as an email [Music] type order now so I had already submitted a request for uh lakmi right so I have already raised a request for lakmi for work as furniture and it is not cancelled or uh cancel it is still either open or complete let us assume okay so in my script I'm going to validate where uh there is already a request uh you know placed on their name so what will I do is so in the filters I will put request. requested for is lakmi right and then um state is not cancelled I'm going to consider all the states except for cancel because because somebody's can somebody's request is canceled means they did not get the product right but somebody's state is completed means they've already received the product if somebody's state says in progress it means it means that it is transit or you know shipping or something like that uh it is uh it is a possibility that they are going to get the product so uh for this validation I'm going to rule out or ignore only the cancelled ones so I will put state is not closed incomplete or and state okay let me put it like this it's not one of closed in complete or closed skipped okay and item item is work desk right I'm going to give it a run so my script is going to check if if I run at least one record if I get at least one record it is going to return me uh duplicate found and accordingly I will do whatever I want right now so we are in client script we have access to look at only the data in client set right meaning whatever form variables everything how can I see a data that is inside a table this is called you call it like kind of server site right because right now when I'm on this form the other table data is all server sites script because I'm on this form I can access only the data and information of this form like okay the name is lxmi requested for self the email ID is but apart outside of this form I will not be able to access anything so whatever is outside of this form in my eyes right now is all called server side data it is all stored in some table right now how do I read my server side data or the table data when I'm sitting in client side itself right so that is what we're going to check now so let us imagine right now you are in a server sites script at that time what you will do I'm taking a some script console just to write some syntax I'm taking a script console so what I will do is you remember the Glide record we learned on the other day so where gr tab you press the tab so it gives you the syntax this is for your easy access but if you want to write it by your own self so you will put where I'm right now putting gr instead of gr you can put RM a b c d f anything you can put one second okay so instead of gr I can put any variable object name not a problem okay and initialization initialization means new and gliding through the records right I'm going to glide through the records of a specific table so I will put up uh um uh the API called Glide record API and the syntax is that as you can see right it gives you an hint of the syntax so we're going to put a table name which is a string the moment it gets to brain it's a string you have to put codes and what is the table name score re qore item right because all the data that we're looking for is right now stored in the table called SC request item fine now I'm going to put up a filter g. add query query of so as I told you on the other day you could add uh you know the back end names using this like I can can put it like this request for requested for first query comma and then J add query request. requested for right so now where is the word request. requested for is coming because uh if you do right click and copy query you can identify that it says request. requested for is so and so right because we kept but we kept request for requested for is lakmi why is it saying Aid because that particular field is a reference field reference fields are always displayed in terms of societes so the value that you obtain here is society so uh the value you have your S ID yes in gr. add query we can put that uh copy URL right correct you can put the cop completely exactly yeah yeah so this code can be written like this or we will try to add one query after each other okay and the other one is state not in is your operand 4 comma 7 not equal to 4 not equal to 7 J do add query cat item comma okay so this is table opening up of table these are all adding filters after adding all these filters you have to click the button called run right you remember that day I told you go this uh line represents going to the table fine all these each each filter I'm adding right adding filter number one filter number two filter number three that is all this this this this okay now without clicking run I will not be able to see the desired results so how do you click on run is G do query right now I have got the records I will be able to proceed from this so now as you know the other guy said instead of putting all of these lines I can use it a one simple line which is encoded query there's a difference between adding query and encoded query so I'll give add d e so it gives me the suggestion so I'll give enter now either in double codes or single Cotes I can just copy whatever query I got here and paste it up here and finish it up with a semicolon right so all these four lines is same as this one line This is a combined query right now now uh our requirement is that we're not validating if it has five records if it has minimum three records minimum two records nothing our validation is oh it has at least it has only one record also then we need to uh return as duplicate request found something like that right so there's two things you can put either you can put if or while so um I don't have to go through each record let us say they have five requests in the past I don't have to go through each record I'm going to check only at least if one record available also I'm not going to allow them to proceed any further so I will put if gr. nextt which represents I have found a next record matching these conditions then I will put return a keyword keyword is like duplicate request found right finished up and finally I will put return ons like this now okay I'm writing all the server script so how do I call my server script from client script right I cannot write a Glide record inside my onchain client script so how do I do that for this you have something called an API called Glide ajx right you have an API called Glide Jax so Glide Jax helps you to call a server side script from a client side script right okay so uh till this any doubts with uh uh how to write a Glide record if this is clear I can tell you which is the correct place to write a Glide record right now I just opened up a canvas for you to write a code but this is not the right place to write and show you where to put that 11th line what record okay if a record exists right validating a condition if a record exist like see uh the moment you go to dot next what happens is it is nothing but literally like hovering onto this record or opening the record in a general context I'm saying I'm trying to translate each of our you know each of our operations against um okay I'm trying to uh you know see I'm saying that this line is meaning you you're going to table these these these lines means that you're putting up filters and this line means you're clicking on the Run button right run button now what line number 11 represents is you are either hovering onto the record or you're opening the record let's say you're opening the record okay and since I had put if it will open the first record that is available if I put while it will open one record after the other one record after the other so if I'm opening the record itself means that a record is found one record is found right now as I told you the moment you jump into line number 11 you are open opening the record so uh you could even print the value of that opened record as in you can print the number of your request item so the number backend name is number so I can print you gr. number so going forward any uh field of this particular record that you want to access you will go with the keyword because the object name that we have defined is gr right so we will put gr do number if you put GR short description it will print you the short description of this particular RM clear right so what if we don't find any duplicate request okay so 10th Line will be the output right else else an is equal to you put something like uh you leave it as empty or you just put it like no records found okay let's keep it like this I'm putting an else right this else is uh see you can uh use your CET to identify this if ends here so immediately else means this else represents it's an else to this if so if this condition not satisfied it will jump into else so I'm at the else condition I'm setting my answer variable to no records found right okay so I will tell you right now I showed you in a can was how to write a script I will show you where do you exactly write a server side script that to specifically uh when calling from a client script so in under system definition you have something called Script includes right when I over on to that it says that JavaScript class libraries I will tell you what is a script include script include is a reposter of all the codes all the codes that you want to keep in the system uh either a reusable codes or a huge lines of quotes like 100 lines 200 lines of quotes uh but you wanted to store in a repository and call that referencing repository somewhere in your script like an incident table change table or catalog form you just want to call that name only that much uh whatever script stored in that reposter it will be called there such a thing is called Script include now from where and all you can call your script include you can call your script include from both client side and from server side and what is a script include script include contains only server siding scripts meaning you're trying to look at the database you're doing trying to do some operations of update Ander and all of that so all those are written in s script includes but this server side script can be called from client side also server side also I'll repeat again script includes is a repository repository means Storage storage of all server side uh huge huge or small script and it can be reusable or onetime script right it could be anything but it is basically storage of all server s scripts and script includes like you can say s script includes okay um You can call it from both client side and server side you can call your script include from both side and C server side so how do you know whether this script include is meant for you know can be called from client side and but the other script include can be called from server side is um I will open up any of the recent updated records and here you have a checkbox called client callable right if client callable is checked true only those are the scripts that can be called from client scripts you have so many other scripts where it says client callable is false right those scripts cannot be called from client side right so um I will write a custom script include let's not look at the existing ones let us create a new uh script include so we will save it as custom catalog utils the word utils you try to to you know put it wherever you find it like you know a package something like that you just give it a name like that the moment you give a name like this it see there's a checkbox called uh this uh service now has been uh given as a package with a lot of scripts already given by the system it's there will be few scripts especially script includes like this which are a large repository so so the service no vendar does not want us to update these so what they will do is they will Mark the production policy of the scripts to protect it so these could be updated see wherever you say protection policy as uh read only or protected see it says protected right if I open this I will not even be able to see what is the script written inside this I know that there is some script include called Dev update tracker you clicks but I will not even be able to see what is script written inside this I'm a developer but I myself cannot see the reason is because on top of as developers there are developers uh development teams in service now right the vendor so whenever they release a package they will uh show few scripts which are uh which are hidden not accessible by even service of admins so uh whichever says production policy is protected can be read and edited or anything done only by the vendors we cannot touch anything in that we will not be able to see anything in that right and there are few things called read only right so you can read what these information are but you will not be able to do any update to these records even though you're an admin you will not be do able to do anything about this but however there are other few things that says None right so these are editable stuffs you could edit them for example there are some something called hrco configuration so these are editable right so these things you could read and edit as well so this is the definitions of the protection policy like uh [Music] um uh you have to make sure that you do not as a developer you do not write uh uh you do not write a script include with the production policy as read uh you know read only or protected what will happen is you system will allow you to create a uh script include or any record with the protection policy as read only or protected the moment you give a right click and save you will not be able to edit it yourself itself you have to reach to the vendor saying hey I have mistakenly wrote a script and I kept it as read only and now I can't edit it now they have to come with your come for your help and they have to help you to delete that or do anything from the database you will not even be able to delete that also so you'll also have to make sure that you don't write any scripts with protection policy as empty or read uh sorry with read only or protected it always has to be empty because instead of contacting them we can create another one right we can create another right okay let us say you have written a logic here like you know show an info message alert like because but while creating know in the starting we will keep some info message or we will keep some logic let us say you know no longer require that logic right now you can't deactivate also you can't modify the script also you can't do anything so as you said you could only write a script include with a different name that the existing one that you have created with the protection policy as protected that name cannot be rechanged you cannot disable it you cannot delete it do nothing about it so that name you cannot use it anywhere else so if you want you can create your new um new script includes with new different names uh so that you don't use the existing names for script includes it's fine let us say I'm going to write a client script with production policy right at that time uh that client script is mapped to that catalog item it is not like you can call it using the name only when it is called it will come no it will be always working on default right then it is even more mess now if you ask me how do we know that we're writing in something in know um uh which is a protect protected and nonprotected Ed is when when the record opens itself it will tell you otherwise out of curiosity what people used to do is right click configure form layout is there right so there you have you will have your protection policy you have your protection policy right so you will think like oh protection policy means like admins non admin something like that and what you'll do is you will bring it in the layout after bringing it in the layout unknowingly unknowingly you might tend to edit this right now this is not editable uh because there is a property to disable it in the client site but there are few places where you can edit it and if you kept it as protected and the moment you save it you will no longer be able to change it afterwards so that is a concern right now I click on new now I no longer see something this is read only or something right so I'm good I can go ahead and create this uh custom catalog util script include that I want to so I'll just give a name like custom catalog utils I'm giving a name like this because I'm planning that going forward any U catalog item I develop and any any client script I'm going to create if it requires a server side validation or something I will use this package inside this I can write 200 lines of Code 10 lines of code to 100 lines of code anything but I will use this package I'm planning this in my mind I'm writing like this so you could see that it forms a syntax automatically so the class that is created right the script include name is what you call it as a class the class that is created is custom catalog utils and whatever functions you want to initialize and you will write it here but now this we want to keep it as a client callable so I'm going to enable this checkbox just watch on this script section to see once I enable this client callable what happens to my script I enable this let me reload when I enable this it will right so I have enabled this you could see that it forms up a different script section right so it tells me that yes the class is custom catalog utils but this class is going to extend an another object called abstract ax processor so I will give you an on line explanation of what this is so you this is going to be a class and you're going to write definitions on your functions and everything but uh since we want this to be client callable we need to make sure this uh class can access your client side elements as well for this service now has created an another script include called abstract Ajax processor in that everything is written right client callable callable prefix blah blah blah blah everything it has been written you don't have to wor worry about anything much what you have to do is as a uh you know as uh uh as a concept of your groups concept of abstraction you are going to call all the functions that is defined in this abstract ax processor inside this particular script include so for that you don't have to think anything fancy nothing much just you enable this system will automatically populate that you don't have to worry but in you know in point of interview perspective they will ask okay what is abstract ax process you have to tell them that oh that is another script include uh you know which has functions uh and methods to U uh access your client side elements so in our client callable script include we need to extend uh and uh um you know extend that uh object so that we get that benefits also it is like a inheritance concept are like uh you hit the properties and good values of your parents your forefathers right like that whatever is the values or methods or functions available in a script include called abstract aex process processor that will be inherited to my class also right in a simpler note that is the meaning now what I have to do is whatever code I have written here I have to just paste it up here I will remove the unnecessary um this thing so this I have to WR it in my function so now how am I going to call this function inside my client script so as I told you we have a concept of Glide AXS right and now request Tye equal to equal to self okay so the syntax goes like this uh you could you know uh since um it's Glide a g for Glide and a for a jack so I'm putting it as GA otherwise you can uh uh you know you can use any uh thing you want like uh req type any variable name that you want to put you can put it shouldn't be a problem so here in new glider jacks I will put the API name it says global. custom catalog utils right and again here add parameter so here you will get the function name that you would write it in your script include so uh since this is a generic script what are the datas we need right now you have to identify what are the datas we would require dynamically so requested for is going to be dynamic uh and then catalog item is dynamic right so here you will put name society is nothing but Glide form dot get value of on behalf and what are the other parameters you would require and then catalog item cat item Glide form. getet unique value so it will uh return the C of your catalog item States other query all right so the script include that we have developed right now is this one and in that uh we let us say we have a function called um get duplicate records okay and this let us also add one more parameter called table name so all these uh see uh this req item table uh this state and all is St I regardless of whoever raises the request right so but why are we trying to put this in the client script is because we don't want this to be stored in the server side script because I'm thinking the same script include could be you uh like you know uh right now you're trying to find duplicates in SC request item right tomorrow you want to find duplicates in some other table like in incident table or probably CM dbci table something like that at that time you don't want to uh create new new functions instead of that this existing one function whatever you have that itself is fine and you could make use of that right so for that sake we're trying to put as much as possible inside your client script itself hello yes please can you please explain from 13th line okay all right so you remember you wrote a Glide record uh you know we wrote a Glide record 10 minutes back right similar now how do we access that client record from a client script uh from client script you need to access some server side data how do you do that is the question for that you have an API called GL GLX in a you know in service now in instance Glide attach helps you to retrieve the server side data want to look at the information of server side data then Glide a Jax will help you right now whatever server s side script I have I have to write it in a script include right now we just wrote it right we have to write it in a script include that script include we have to call it here so what I'm doing in here is whatever uh API name that I created there right so I will put where G is Al to new Glide Glide a jack off the script include name so instead of putting G you can put any variable object name of your choice I've just put GF for now and there uh you need to see as I told you in script include you will have hundreds of function right so uh my script include can have hundreds of functions so I need to tell the system hey go and look at this function so I'm going to tell my system go and look at the spam function name name that goes by the name get duplicate records so this is my function name right so I'm going to give few more filters to it like in Glide record you have some filters right similar to that you can give more filters like one filter called cpam table name cpam name Sid so all these name Sid and all is my own names like it's like a variable name but you have to make one thing a constant that everything starts with the keyword sisam underscore okay so I'm giving like four filters so after giving four filters now I'm done so so I have to get the uh response from this right so response I will get it as an XML only so all your uh ajx calling you would get it in XML only so I'll put get XML off my output I'll put this again the name that I randomly give you can put it as something else now whatever I got uh you know around um this output I will read it inside this my output function let me write it first and I'll explain you what each represents if let us see my return return output says uh duplicate found I'm going to give an alert to my system stating duplicate um request found request cannot be submitted in addition to that we will also clear the values [Music] of uh clear the values of on behalf okay so okay now that I have written all of my uh details here I will proceed to explain what each of them is capable of so I'm writing a script include called global. um custom catalog utils that is my script include name and inside that I might have hundreds of function so but I want to concentrate on one function that goes by the name get duplicate records this function name is again my own defined name it is not like a system name or anything so in there I'm going to give some queries like it can be one query one filter like see in uh when you run up this filter it is up to you whether you want to put three filters one filter or anything like that right similarly in my script I'm putting um where is my script I'm putting like how many filters 1 2 3 four four filters I'm putting so the line exactly next to uh Glide Jax with parameter name as cpam name is your function name rest all is the parameter names that you develop on your own and once this is processed in the server s script you will get an XML output so that output you have to use it as a call back function what is a call back function is instead of you know deriving the answers right away here you will uh you know put it in a function called my output and the response that you had received you will handle it separately as a function so this is what you call it as a call back function so uh you get a response right you get a response resp through in your XML so in that response uh you will get it as an XML only in XML if you see you will see several attributes if you have noticed the XML of any data for example let me show this exml show XML of this record you see lot of attributes right approval is one feel approval set are the different attributes in that there will be one attribute called answer which will store the exact answer right so we want to concentrate only on that attribute so we're reading that attribute from the response we got if the attribute says duplicate found then we are going to give an alert message in the client script like this and we are going to clear the value of on behalf why are we right now clearing the value of on behalf uh it is because we found that for the same user there was already request right so let us clear this value so that they can raise it for somebody else or let us say they again they put it as lakmi then same thing will happen so I will also clear the value of this and clear the value of um my request type as well all right now that we have developed the client script I will show you the completion of our script include where is our script include okay here I have my script include okay so remember the function name that we just used it here get duplicate records right so this is your function name uh so inside this space let me come in the existing script to avoid confusion foror your end okay so exactly after this AB abstract Ajax processor line what you would have to do is uh you have to put your function name this is a syntax function Name colon function declaration right open and close curly braces and then finish it up with the comma Now whatever you script you feel it like you will have to put it here put it inside this function okay now this line understanding is done right see uh custom catalog utils is this one custom catalog utils this function name get duplicate records is get duplicate records now where are you going to bring your this parameter this parameter and all is so here you'll put like where name is equal to um get the parameter of uh a specific like this dot get parameter of name society right behalf of so one is the one is on behalf Society the other one is the catalog item Society right so I'll put catalog item the other one is other query the other one is table name cat name other query and then uh table name is tab name okay now either you could you know directly put it here like this or you will just use this as a dynamic so instead of putting scq item you will put it as tab name so what is the tab name that we have obtained from the client script the tab name that we have obtained is score requestor item so which is a dynamic value and again all the query right now we have hardcoded it right so instead of hard coding what we can do is gr dot add query of request. requested for comma behalf of right so now you understand why we are trying to bring it like you know you know it is not like we're trying to complicate it but we are trying to bring it as one Dynamic script which can be U ized in several other client script not just this one but we could use it in several other client scripts also so that is why instead of hardcoding it we're keeping it like this so uh otherwise if you want it to be very static no no I don't want it Dynamic all these you know exaggeration and all I want it to be static but for my uh work desk calc so with regard to work desk what you would require is only this on behalf the other things and all you don't requir it because uh when we are working for work desk we know that we are going to evaluate in SC request item table only this one is going to be dynamic otherwise rest all is static like we are going to evaluate it against the records where state is not one of this this and catalog item and all of that right so if a record exist it will return answer like this I else it will return answer like this this right so what you have to finally you know uh set as an output is return ons job done okay so now that we have changed all of these as Dynamic you requir only this on behalf of you don't require the table name or anything so all these L come in this up okay so if you identify what we doing is we going to the script include we are uh calling one specific function called get duplicate records for work desk let me change my function name correctly here as well and you are passing one parameter which is nothing but your on behalf of value so that you're passing it in the parameter called spam name a variable called B of your and you're writing your Glide record so if any one record found also you're getting this uh you know answer as duplicate request found let me put the exact same word else it will say no records found and it will return this right let me save this up I'll try to put an alert on answer here as well and I will save this as well so we could do a demo for [Music] you okay since we just Chang the CLI script we got to reload this form only then the changes will be reflected and this script we have written on the change of request type only so when I put self only then it the script will start evaluating so it says that duplicate found okay duplicate request found request cannot be submitted right right so if I put it for somebody else other than lakmi um I'll put it as it admin request for self so it says no records found did you identify the difference I can show you in a different way as well for so I'll put Lakshmi name here request for self so it says that duplicate found RM duplicate found RM is RM number 13 and uh it says this message again so you could see that RM 13 is on lakshmi's name that is the reason um with this demonstration I will again explain you what the script is so that it gets into your brains um see uh we need to evaluate in the database in RM table that for this user for whoever names that we entered here do I have an open record right if I have an open record then I should give them an alert message and clear out this values of this and clear out the values of both the things this is my requirement now I am in client site I will not be able to retrieve the data of server site now how can I achieve it I can achieve it through an Glide API called Glide Ajax now how do you write a Glide ax right so in your onchange client script so we want this to be evaluated when you change your request type field right so in your onchange client script uh you are checking your uh field value whether if it is a self or for team only for self you're going to do this so once it is identified as self the script from line number 10 to 27 will run now what does my script between line number 10 to 27 does say is it goes and looks into a script include called global. custom catalog utils so you can see that you know it forms an underline and you do a right click it says open definition so the moment I give it it opens the script include in a new tab so the API name is global. custom catalogs that is the name that we have given here uh and the API that we're calling is a glider Jax and this is obviously marked as client callable only because of that uh if you write here it is working imagine if I uncheck it it will not work right now um I need to get some data from these functions see so this is one function right like this I can write 100 functions like another function called get DD something like that so I can write 100 functions inside this one script include as I told you a script include is like a small Library you can have 100 Pages inside this book so but you want to look at only one specific function right so you have to tell your client side system which function are you looking for so the function that we are looking for the name is get duplicate records for work desk so we're telling instructing the client script that hey uh the function name sisp name is get duplicate records for work Des so what system will do is uh will do a control F here right it will find this function and after finding this function we are sending one parameter that one parameter is that there's a we have created one parameter called name S ID like instead of this I can give anything right it is my own defined name whereas this one is standard you should not change it it was always syamore name only whereas the other parameters like filter parameters it is uh mandatory that it has to starts with the prefix spam underscore but after that you can give whatever you want to not a problem so we gave the name as name society right uh in the what are we passing we are passing the on behalf of form value the on behalf of form value is a society of uh Society of this particular person right if I put lakmi is lakmi society now uh this data you will get it in your server script using this particular uh you know uh particular uh method there's a method called get parameter of whatever is the parameter name that you defined in your class line script so that parameter will be received and it will be stored in a variable called BF of this is name you want you can give it now that you have your uh on behalf of name so since you know that this function is exclusively for work desk you know all other filters what are the other filters state is not one of closed incomplete or Clos skipped uh catalog item is work desk and all of that what is the other filter that you need you need who is the requested for right that filter alone we are getting it from the client side rest all is stored here itself The Who For Whom the request is for that on behalf of variable alone you're getting it from client site rest all you have so that you are adding it to your query now if I find at least one record I'm going to set my answer variable see I have kept one variable called ANS that answer variable I'm putting you know I'm putting it as duplicate found RM and giving the number also because I'm thinking thinking if I give the number also it'll be even more easier if I don't find it I'm going to return it stating that no records found right so any questions with how the script include has been uh written okay so uh now the answer is processed and the answer stored in a variable called an any script include the response you will get it in XML only I I showed you an example of uh how an XML looks like right so it has this value key pairs now so you have uh passed this uh script include name and the function name and the filter uh you know parameters you're going to get your XML output so that output uh you will uh you know decrypt it or uh you know you will uh dissect the output as an uh response so um see if I give Val here I have to make sure the same Val I give it here right it's just my custom name so whatever is the response I receive it here and that response also I will get it several attributes like uh answer and output like I will get several attributes in the XML in that I want to only focus on the attribute called answer so I will put up a syntax like this in my response look at the response XML in that there are several document elements in that uh in the document element there is one attribute called answer just find it and store it in my variable called answer okay since both of both of these says answer it might be confusing for you uh I'll put it like this op okay so uh there's an attribute called answer whatever value it is found there just store it in my variable called op now if my op is not equal to negation means not equal to right this one means negation which means not equal to if it's not equal to now records found it means that record exist right if it's not equal to no records found means it is the opposite which means record exist so it's going to tell you an alert stating that uh duplicates request found request cannot be submitted and it will print that op op is nothing but the rhm number whatever got you know printed up and it is also going to clear out your on behalf of variable and your request type variable it's the same script just I just uh you know renamed a few things like op and things so that you don't get confused oh your also answer your also answer so which answer they are referring to you should not not get confused that's why I gave it a unique a different name any questions on this right if I give something else some other names it will not show me an error no records found so will allow me to submit the request now for it admin let me do one thing for it admin let me submit a request so now that I have submitted a request for it admin so next time system will not be allowing me to raise another request for it admin let me reload this form I'll put it admin request for self so it says that duplicate record found right it cannot be submitted you understood the difference right any questions with whatever we learn so far so if you can understand Glide record and glide a jaxs and all these G form apis uh like 50% of the scripting is done we will also look at another example tomorrow uh only then it will be you know um it will be stored in your mind otherwise it might pass as a you know pass as a cloud so we will I will show you another example Le uh using both U script include and client script tomorrow as well but today whatever I have done now just try to reproduce in your personal instance so that the practice you know gets into your muscle memory any questions so far all right I take that as a no so we'll get closed for today's session and we'll reconnect again for tomorrow thanks guys thanks for joining in I'll stop recording of the session and one small thing like we left it halfway through so I was talking about variable sets right so variable sets as in it you can call a variable set as um reusable variables stored inside one box like uh let let us say you have a variable set called new user details and you have a lot of information in that you can store it inside one box and recall it wherever you want right and while creating a variable set recording has started yes it is so you could see it here right the it uh it is being recorded right uh so there's two types of variable set one is single row variable set and the other one is multi row what is a single row is it's nothing but you could create multiple variables and just you know uh say that it is a category right uh whenever you know probably um request a name request a manager request a title um business uh requirement so these four Fields might be common for all cataloges right let us say there's a requirement that these four fields are common for all requirements now for each and every catalog you don't want to recreate the same variables again and again what you will do you will create one variable set called requested uh requester uh details uh um commment like that and then inside that whatever variables like four or five variables that you want to create that you will create now instead of uh uh creating this uh four variables in every other catalog you are just going to go to this place called variable set in the related list of the catalog items click on edit and pick up the existing variable set that you have right so this is one purpose of variable set the other one is you have an thing called uh multi variable set so the other day in you know 3 days CL back last week we saw this so we created a variable set called new user details and uh it was asking what is the type of the variable set we have to give either single row or multi row so we gave it as multi row again same like whatever we feel we created multiple varable abl however we wanted now the difference between single row and mul row is I can in the uh in the service catalog so this is the multi variable set that we created so you could see the difference right here it forms like a tabulation whereas the single row variable set will come like three questions one beneath the other or left and right however but this one multile variable set comes like a tabulation meaning you can add multiple rows of as the name suggest you can add multiple rows like for example Abraham mile number AB at1 123.com add right and this button you could use it to edit any feeds that you have you know incorrectly keyed in and this one to delete the row and this one to keep adding as many rows as you can and it gives you a functionality to add add maximum 50 rows and if you want to clear out this entire bucket you click on this button so I'll give one more row right so you understand the difference between how a single row variable sit and how a multi row variable set differs right so there should be there could be some requirements wherein they wanted a tabulation structure like this of multiple user data and they don't want it like in paragraph they want it like proper organized structure like this so you can't keep on creating person one like you know person one label and person one name person one phone number person one email ID you can't create as many as you want right right it is difficult so at that time these multi variable sets are very handy and helpful so it will make sure that you just create one set and you could accommodate as many user data As You Wish inside that content any questions with single row variable set and multi variable set in general context variable set itself is a reusable variables which can be kept on being you know called or reused in any catalog item that we want that is a general conent of variable set but in that also you have a speciality like single row variables multi variables set is a collection of variables like more than few variables and uh when you create it using single row type it will come like this you know one after the other like that but when you do it as multi row it comes like a tabulation I'll show you you choose single you know variable set so when you try to create a new one it asks you what is you know what you want to create single row or multi row multi row will render output like this single row will render output like this right all right so with this that one part of the variable set we missed that also we covered now we'll again jump into the scripting cludes to revisit uh on other day uh I think we wrote a logic I kept these tabs open for us we wrote a logic such that when we try to requested for self the system is going to validate whether do I have any existing record in rhm table meaning for the same user for the same behalf of person meaning I have already requested a work desk fit for uh you know uh through this catalog in the past if it is so it will tell me that no you already have if not it will say you know no records pH so that we are good to continue right so we created a um we created a client callable script include here and also we created a um client script and we made use of this Glide Jax this glider Jax API in order to call the script include any questions with specific to this script include and this client script let me know if you want me to you know walk through this one more time we will do a quick recap or review yes yes yes please do that all right okay so um script include as an um it is like a reposter of multiple scripts you can have one or multiple scripts and it could be used any way you want like you could call that see script include is like one repository whenever you want you go you know get the data and come back you go get the data and come back you don't have to write one big logic everywhere in your business rules or client scripts or other scripting places script include plays as a repository of multiple scripts right so all these multiple scripts you could put it one box and that box you can call it as a class right inside a class you have separate functions now I will create a new script include to start with like um training test SI s represents script include all right function of just give me a minute let me write it and then explain it to you okay um so uh when I tried to create a script include what system did is automatically see I'm trying to create a script include right minus one it's a new record you can see new record so I put some name right once I put the name and take my cursor off the screen it automatically creates an API name API name is important this name doesn't matter actually API name is nothing you know complex just that it looks at the application name uh puts in small case dot the actual name that you suggested for the uh script en clue so that is your API name and it automatically creates a class for you and it it its class is like not inherited from any class or anything this is a a script include normal thing looks like um so um when you call it a script include there are uh you know three two types actually one is classless without class without class the other one is with class so if you see here I wrote a script include there was one syntax formed but what I did is I removed all of the script and I just get you know uh wrote something like function and my function name whatever I wanted to give so I use the same I I have to use the same name as my script include and then whatever parameters I want to pass it in my function and whatever mathematical operation or anything that I want to do right so this this I will do it here and that value I'm going to return it uh as an answer so here you don't find anything called class or anything right so this is what you call it as without class functions now uh there is also something called with class so with class is that uh you will have to define a class and then you know write on your script now what is the difference between without class and with class is without class serves as only one script you can't do anything much just one script you can't write anything else you can't uh uh it is not like a package of multiple script it is just one script because when you write it without CL what happens is your function name should be same as script include name right so when function name is same as script include name can you write more functions no you cannot you can write only one functions in that entire script right so uh the functionality is very limited with regard to uh without class script include but when it comes to with class what happens is you could create more functions as you want uh for example I'll tell you let me say my function is also you know uh uh this thing so as you see here the syntax goes like this your function name colum function of and then whatever parameters you want right let me disable this one I'm disabling this because um without disabling also the other one will work but to avoid confus from your side I'm trying to disable this right so um I'm writing a script include called tstt right and uh the moment I take my cursor off there automatically a syntax gets formed so now I see that system has automatically created a class for it so my job is to create as many functions that I want let me start with my first function my first function name is training test SI this function name does not need does not necessarily uh needs to be same as your script include why because this script include has a class which means that it has a capacity to hold multiple functions so I can give a unique name to my function and uh the syntax goes like this the function name and then the function declaration and the parameters that I'm going to pass so the parameters I'll say like a comma B you can put it like you know anything like it's just the variable names I have used alphabets you could put names or anything that you want of your choice again I'm doing a I'll do X comma y the reason is because in this place I'm putting up a logic that um I'm defining a variable Z and I'm mentioning it as that uh it is a summation of the two parameters X and Y and it gets written with the value Z right so I'm going to save this up now now I'll tell you how this gets printed and how this gets printed in the back end I'm going to De activate it again okay to make it more better I will give a different name uh from that but the names of the script include and that script include nowhere is related and it can be anything or it can be same also doesn't matter just for your Clarity I'm giving different names so that you don't get confused fine uh so any type of server side scripting that you want to validate it you don't have to you know put more efforts on writing uh the logic or anything you could uh use the uh background script place so how do you navigate to the that is you type background and under system definitions you have something called scripts iph background so you go to that and here um let me show you a few things GS right GS means Glide system so you have few syntax like you want to print something so I just put gs. print off and then whatever string that I want to print inside the parenthesis so it's it printed me that hello right now let us say variable X is equal to 10 variable Y is equal to 20 now gs. print of x + y Okay g is do print so it tells me that 30 right so now you understand what is the functionality of GS printer so it basically prints in the um you know prints in the uh background but if you want this to be stored in the logs table there's one table called log table right this table called Script log statements and you want some data to be printed here right because so that you could check your logs or something so if you feel that you want it to be printed in the logs table what you have to do is gs. log right it not only gets printed here but also here let me refresh the screen okay there's uh multiple records so it's uh difficult to find it so let's do created is 2A okay so you could see right 30 30 is the value got printed however uh to be you know unique we will put it like this my returned value of sum is okay so I'm putting up a string called my return value of sum and after that I'm concatenating it with X + Y so at that time this plus represents concatenation this plus represents addition system might get a confusion uh to avoid the confusion we'll put variable Z is equal to x + y okay now you could get a question like okay how come uh system uh you know clearly added this instead of putting one20 it could have done a concatenation right how could system do this it is because this one is also integer this one is also integer that is why system is able to add it either otherwise if I put it like um if I put it like you know in quotes you could see that it concatenated like it joined the two numbers one 0 two 0 it did not do any addition the reason is because when I put it as a codes systems know that oh this is a string but if I put it without quotes system knows that oh it is a integer right so you could find the difference here so I'll put log and the value is like this right so it says in the back uh you know in your back uh backlog statements that my return value of sum is 30 whatever you wanted to print it comes and stores in the logs table so the differ difference between keeping it in log and this one is print is print is like you're just practicing or testing or validating your script right at that time you want to see but log is whenever that script is called for example uh if I put a gs. log here whenever that script include is called at that time it will go and get stored in the logs table so it is easy for you to you know tomorrow come back and look at the logs for what happened on the yesterday when this specific script was running so it will be easier for you to go and have a check through there now um right so this is how your background scripts work now how do we call a a script include without any class just a function from background nothing much you have to call your uh function name and the function name expects two parameters right so here we are uh in script you expecting two parameters X and Y so you could possibly put it like 9 comma 2 right so this is what you call it in your function so this function you could just you know store it in a variable variable uh testing value so you store it in a variable and finally print the V uh variable like whatever is the return Val so it uh returns with the uh value that the value is 11 so which is nothing but U you're calling out a function called training test SI so if you look at the word training test SI it is nowhere inside the script so the moment see something like a function like this it goes to the script include and looks for uh looks in the entire script include table hey do I have a script include name called in test si uh yes system found one so after finding one uh what it does is it goes and uh you know keeps this substitutes this parameter one and parameter 2 at this place so now X becomes 9 and Y becomes two so here we are doing a simple mathematical operation of addition of both the numbers and storing it in a variable called Z and returning the value of Z which is nothing but 9 + 2 is 11 so it gets returned whatever is the return value is stored in a variable called testing Val that you're printing any any questions right now with uh how do you uh use a without class simple function like right now this might look like a simple mathematical operation right but uh instead of that you could write a Glide record try to update a record something like that meaning uh let me say update my my incident um I'll put the incident number sh description test description okay so previous example I showed you that it is a simple mathematical operation right so instead of that now what I'm trying to do is I'm I'm trying to um I'm trying to create a script include called uh update my sh uh incident short description so there I'm passing two things one is my incident number the other one is my short description value so what I shall do it here is I will write my Glide record so this is something that we learned two classes before right so I'm going to my incident table and putting up a a query like uh first query is number is nothing but x x is nothing but the incident number right number is X and then you would obviously find only one record with the same number so what we doing is we're going to set the short description of that record is equal to y j do update right now uh you could just mention it as written X Plus dat okay so as you see here again you have function called update my short uh short uh my inser in short description so inside this uh uh you require to parameters one and you know X and Y again I'm just putting X and Y instead of that you could put like a num short dis whatever but whatever you're using you have to make sure you have to follow it in the below also wherever you're calling or referencing it so instead of doing a simple mathematical operation of X and Y what we're doing is your logic is different uh we going to insent table and putting up a filter stating my number is nothing but this value and then running the query and if I get a next record then set my gr gr means the record right the record whatever youve received the records sh description the value of y why that was passed and then this record needs to be updated your putting up a you know command that updated so once updated so you're going to return return stating that X is again your number right so it will say Inc blah blah blah updated the word updated like it's a string you could see that it's between the codes right now let's do this all right so I have already in background script uh I'm storing a variable called testing Val and then I'm calling a function called this one and passing two parameters insent number and test description so let me keep this uh instent number also open in another tab so you could see that previously the sh description of this one is different like sap materials something is there so I'm going to do a run okay uh so these are all like background logs you know because you're trying to update records there could be few things happening right so those are the things you could not worry about it but whatever we returned we returned that we wanted the system to say the insent number space updated the keyword right so it got printed here also we wanted the record to be updated with a short description so as you can see I'm going to my short description you could see that this info icon means that somebody has changed the value uh meaning it could be system or it could be anybody for example let us say I'm keeping this form open where else uh we have let us say we have sushita accessing the same URL in her laptop and uh she's changing the instruction for from uh X to something else at that time I have not reloaded by form right however system will show this icon which means that somebody else is changing the values of this record so now in this case while I kept this form open my background script was updating my short description as test dis right so it it shows me this different icon but as you can see as we expected the short description got updated here right so this is a typical example of you use a class without class classless function but the drawback in here is that you could only use uh you could uh make utilization of the script one function it could be a big function could be a small function whatever but just one function you can't uh encourage or you know utilize multiple functions in that so this is a classless function right so now let us get into with class function okay so this one is a with class function it is not a client callable it is a with class function meaning the moment I just gave a name System created a class and um it was like this now inside this I will write my function but you have to you know keep you syntaxes in memory uh if you want to write a with class function function Name colon uh function uh uh declaration and then uh two parameters three parameters uh maximum people put three parameters or you can even have one parameter or no parameter also right like this and the Syntax for calling it from back end is exactly same but just that here it is a little different as in you have to give like this um I'll put it from fast variable X is equal to new script include script include name script include AP name dot function name a function name is this right function name then inside this whatever parameter you want you have to put so here the system is typically expecting two parameters X comma y so I'll put it like uh 22 comma 4 right so again the same addition for you to understand the syntax first now what I shall do is just print of X so I would be expecting 26 as an answer here before that let me save it run it yeah so you could see it's 26 right let me write an other function training SI with class multiplication multi okay uh so what I shall do is without putting x + y I'll put X into y so here in the function I will put it as training test SI with class multi uh the script include I'm calling is the exact same global. tester but just the function that I'm calling is we have two function if you see on the screen we have two functions now one is this this function the other one is this function so instead of first function I'm calling the second function so if you run it you should see a multiplication answer being written 22 into 4 is 88 right so like this you could WR so here can we call two functions at a time no no so if you want to call two functions at a time like addition Val multi Val okay so I'm I'm I I have to put two variables like I mean with one line of code I cannot do it like I'm I'm creating a new variable called addition Val and in that I'm calling the same script include but the function here is training TR SI with class and and same parameters I'm giving I can give same or whatever okay it could be anything so let me put 10 and four here and then I'm putting up a new variable called multiv well there I'm using the script include obviously uh but function here is different it says that it is CL you know training test SII with class multi now let me print addition value my addition value is same like that let me print after that my multiplication value so you could see that my addition value is 14 my multiplication value is 1880 88 so this one has called the uh addition script this one is called the multiplication script right is that clear here all right so now um if you just try to compare this one with the script include we created on the other day right if you look at this um you forget about the slide record and all like it it might be confusing right but basically okay uh so the major difference between this one and this one is what do you see what do you see is that in uh server side callable with class function the parameters are put inside right whatever parameters you want it is stored inside whereas here the parameters each one of them are called by this syntax I'll repeat again uh this one is a client callable script include right so the difference between client callable script include with class and the server side callable script include with class is exactly same except for the way how you bring the parameters so if you see here the parameters are called within the function okay so as I told you the only difference between um a client callable script script include and server side script include it's exactly same but in terms of script include it will look a little different in terms of how you're calling a parameter uh in server site callable script includes the parameters called within the function uh you know function declaration like X comma y or X comma y comma Z like that whereas uh where if a if a script include is called from a client side then it will be processed using this particular syntax meaning each variable variable a b c and all like we'll have to follow syntax like this dot get parameter of whatever the name that you gave it in your client script in client script add par Pam you kept on giving several names right those names has to come otherwise it's all the same any difference now we have seen without class with class in with class also two types uh client callable server side callable so the difference between client callable and server side callable is how you call the parameters in server side callable it's easy like just in function parameters you put it like a comma b or whatever you know the names and pass it easy eily but in client callable just there's one extra step you have to use a syntax this. get parameter of whatever is the uh you know argument name right the parameter name that you gave in your client script that name you have to use it here that is the difference any question so far so when both the results are same why do we use two type of cbles okay uh let us say um you're writing a catalog item right we were working on this catalog item now only when the record is submitted uh it will go into the server and get stored right see I'm just filling up like whatever I want I fill it up whatever I want but it doesn't make sense right only when I save it it is stored in the system see if I'm filling up the form and I have not yet clicked on order now button now uh let us say you know Mr X you know let us say you you log into your system will you be able to have an idea what are the details I filled it up no until I submit it does not get stored anywhere in the table only when it gets stored in a table like RM or any table you will know oh these are the details lxmi has entered so it means that until a data is stored in the server side you will not have access to the data now before a data is stored in the server side you want to do something validation before submit before when let's say this example only before submitting the form to the database itself I want to do a validation whether the same person call system administrator has raised the request for the same catalog anytime in the past if so I'm not going to allow them to submit this request right at this time the data is not stored in the database how do you valuate evaluate so you have to take the datas from the client side whatever value that you F and just cross verified with the information we already have it in the server meaning the existing record database at that time client callable script includes are important right so it all depends based on your requirement got it all right now so I showed you in background script how easy it is to call a uh server side aable script include from your background script or any server side script so as easy as it is to mention in script it is easy to call also just you put your uh you know um the function declaration for new initialization and then your API name whatever name that you got uh finished up with the parenthesis and put a dot and then function name and inside the parenthesis it could be one parameter multi-parameter maximum of three parameters and then that's a job done uh but with coming to client callable script include you have this extra step of the way that you access the parameter right so when the script include itself has this extra parameter uh just imagine the client script so it means that in client script also the steps are high meaning there is a set of four to five lines uh which you have to remember as a part of syntax but don't try to just memorize but I will give you explanation uh but you know on a long run what will happen is it will become like a muscle memory to you like you know for Loop and all like in C C++ you you know the logic but it comes like a mle memory right you keep on typing that so like this so you these few things like for example Glide record Glide all these common scripts that we use repeatedly uh you have to write it so many times that it it gets stored in your muscle memory but it is equally important that you understand them in the starting so this is the client script that we wrote on the other day I will uh explain this again back to you so what we doing is we looking at the request type and we checking if uh my request type is self if it is self I'm trying to see in my database whether with the same person for the same person any request is already raised right in order to do that I what do I require I require a slide record and a query stating requested for is my system administrator or whoever's name is there in the field called on behalf and then I know the catalog item name I'm going to see if a record exist or not right but unfortunately I cannot write the Glide record in C script so what I will do I will write it in script include and whatever script that I need I'm going to uh call it from my client script using a Glide Ajax so the Syntax for Glide ax is this variable object name any name that you can give and then initialization of the um Glide a ja and then the script include name and next line is adding first parameter the first parameter is nothing but a function name so that will be always by default sis bamore name this parameter name you will never change if you change it will not work this is constant these are like reserved keywords you know in other words you could see say that these are reserved keywords for function cations and then whatever function name that you wrote it there in the script include that name you have to give next whatever comes those are additional parameters as I told you you could have you know like a b c and all right so this this one you can keep it like sisam a cpam b right but everything has to start with the keyword spam underscore uh here here we are using only one parameter like you're trying to get the form value in the form somebody has filled in a value called on underscore behalf right onore behalf is nothing but is this one so this value stored in the parameter called syamore a and you could also keep as many parameters you want but for our requirement we thought this is enough but I'm trying to say that you could have as many parameters as you want right so you're calling the script include and you're telling suggesting the system oh this is the function name and you're uh giving one parameter like oh this is my client side value because without parameter why do you want to so here onore behalf is a backend value of request for request right uh onore behalf is the backend value of my request on behalf of variable yes request on behalf of variable right and you could give multiple function if required or just multiple parameters if required like if your requirement is a little more complex or lengthier you would continue to give more uh uh this thing right now I'm only validating based on my uh uh based on my uh request on behalf of right somebody could uh somebody could uh you know even validate based on the value you entered here and your value you entered here so let if that if you want to do a combined validation you need both the parameters right so you have to give add param of sisam X is GL form. get value of on behal and then u g. Addam of pass users um cpam users is C form. getet value of Entry pass users like that you could add multiple parameters as you want so all these uh response from the server side you will get it as only as XML so this xmls you have to decode it decode it and find an uh returned attribute uh called answer so U so this you call it as a call back function here so call back function is nothing but I mean you have to put your function name here and then that uh processing right you're trying to process the value that processing value you will write it in a separate script separate script outside this thing if you see right here this C bres got ended up here and this function name that I just gave it here that will be returned in separately and whatever value was uh received from here it will be uh you know uh considered as a response so this is again a uh keyword uh uh you know standard keyboard called response but this function name it could be of anything here we have just gave it like B like [Music] that so here we are giving it like a response dot in response you're getting the XML and there you uh you have these document elements you're getting an attribute called answer so this is a standard syntax anywhere you go so uh once you uh you know take it this will contain the value of uh the value that you retained from your server site and if the value is found to be so and so you're going to do anything or if your value is something else you'll do anything so after getting the value however you want you could modify the data and handle it right so right now we just trying to keep an alert and just clearing the value because we identify that uh we found that record exist if we trying to clear the data like this you could do any type of setting up of the values or setting any value of the form anything that you could do any questions so far any questions with so far with regard to classless function so 30th line is mandatory right I mean that's right yeah it's the same Syntax for every right every uh same syntax to call any script include from a client side yes so uh to jump into scripting two things you have to you know practice several times one is your cide record the other one is your script include script include calling from a C client script C right uh besides that the gcore form and all like these are very simple things like on the go it will be easy for you just two syntax you have to be very thorough of the syntax and the Glide record syntax and this G form. get value set value current. get value set value and all is like some extras meaning those are not like complicated it is not like a logic or anything just those are functions uh to perform a certain operation so do we have any application that says what is the use of each API yes you mean to say documentation yes yes yes I have it I'll make sure you guys get it by today you should have received it by Tuesday itself but yeah I'll I'll insist admin again uh to send that specific documents to you so guys let's take a 10 minutes break and we'll all be back by 9:5 okay right now it's 8:55 we'll all be back by 9:5 I shall go on mute thanks guys we'll uh meet again at 995 started like any questions with so far on uh without class with class and uh uh in with class again you have two types uh server side client side callable any doubts so far so what we've learned is a script uh you know syntax of it however complex logic or simple logic ISX the same just that your further undergoing logic will be different for example you want to evaluate two items three items or you want to process it in a different table and then retrieve the data the logic will be different um based on that the lines of script and uh the complexity of the script might increase but besides the syntax is all the same so when you start with uh to be very clear of what is a syntax you go with simple simple exercises uh with simple examples and simple syntax you do 10 you know you do 10 different uh things of the same sort after that you could Leverage it with you know complex requirements like evaluating two fields and then you know subtracting with one and fetch identifying this record in a different table so all these you could go further from there but so far any doubts right all right so if that is fine um we will go into the actual server sit scripting which is business rule so if you look at Insurance in insent table right click configure all right so it will tell you what are the components required to build up an application in the past we had seen um client scripts UI policies um uh you know dictionary entries right see dictionary entries we have seen client scripts you have seen onload on change on submit and uh dictionary entry overrides we have seen notifications we have seen um UI policies we have seen and data policies we have seen so now in line scripts you have seen how do we call a server side scripting as well which is from GLX so what we need to see right now is script uh you know the the actual server side script called the business rules so whenever I say business rules you just translate it with like server site calling right so let's create a new one on the insurent table business rules applies only to um tables not like catalog forms or anything okay so um info message when assignment group is changed okay so this is the name that I'm going to give to my business rule and my business rule shall run on the table called incident and when I want to run it right so to do that I have to enable this Advanced thing uh by default you have to keep this uh you know Advanced checkbox enable so uh this uh three things to it when I want this to be run and what I want to do right so when I want this to be run is before a record is updated or after record is updated so let's keep after record is updated so after a record is updated and whenever satisfying this specific condition so this specific condition is I'll say that assignment group changes so you could see that there are several operators like is assignment group is service desk assignment group is not service desk assignment group is empty is not empty starts with ends with contents and all of that right and you have an option called is dynamic also it gives you list of one of your groups so I have chosen this one so you have options like it's one of my groups and all of that so it is nothing but like you might be mapped to like five groups six groups right so if the system identify that the person whoever changes the assignment group uh if they um if the system finds that like um that assign assignment Group Change to value is nothing but my group then it will um uh you know it will process the next uh set of the script so like that filter conditions you could put in our case we saying like whenever it changes basically at that time you want to do so at that time what you want to do do you want to set your field values or you want to set a message or about action so let us do a set value um so let us set the value of followup to a specific date and time right 1 minute all right so uh you might want to set up the field values or you want to give up info message like for example um assignment group has been updated right so if setting up a value is simple you will make use of this box but if you wanted to do some complex actions then you will go ahead with your script section and also you have an option called abort action uh so like you have some requirement wherein when specific condition satisfies um you should make sure that that record is not updated right so when uh when it is a priority one and people are trying to remove the assigned to field at that time you have to AB the action you cannot remove the assigned to field so at that point of requirements we could uh you know make it as about action true okay I will do that for you now now priority is critical and assign to gets changed changes and assign to is empty so this we will have to do before uh before update because after the record gets updated what is the point of aboring action right so before somebody saves the record that has to be done so um Inc P1 empty assign me okay so priority ones are um very important tickets right so you can reassign it to somebody that is fine but you can't leave that as empty like even for a you know fraction of second also you have to you cannot leave it as empty if you want to reassign it reassign it to a specific individual do not like leave the Q Mt so let us say that is a requirement then what we can do is we can write a business rule like this before a record gets updated on the incident table and as soon as three conditions satisfied uh priority is critical one and assigned to field is being changed and assigned to has been kept as empty when these three conditions satisfied so you can say them a message that you cannot um empty the assign assign me value for a P1 instead instead you um you can reassign to specific person and save the record right this is the message I'm giving and I'm also doing an abot action let me save this up so let's take any P1 ticket here here we have so previously it is with Beth angelin I'm going to remove this up so it's pre one and uh assign to changes right that's what i' given assign to changes previously it was Beth Angeline I'm removing it and I'm trying to save this record so it basically should give give me the info message and also an abot you cannot empty the assigning value for a P1 instead you could reassign it to specific person save the record and it says invalid update right meaning it does not save the record if you refresh the form you could see that whatever it was previously it is there right any questions of how this has been handled this particular requirement all right so now uh like the message that I got it right I got it in blue color um so let us say you have a requirement that no no I don't want to get it in blue color I want to get it in red color that cannot be done at this place because this itself says it's a message it's not like a error message or anything so what you can do is instead of utilizing this functionality you could go to server side script and here you could put gs. add error message because error message comes in P what color red color give this error error message and Che start let me look at the existing Scripts all right so um in order to jump into advanced script you should not about it right right away because right now uh we don't want a blue color info message we wanted a red color error message so anyways we need to jump into Advan script but in order to jump into advanced script uh you can only write it in the script section but when you keep your uh abot message right here what happens is you will not be system will not even look at what is there in the Advan script it will WR away about this functionality so in order to this to happen you have to uncheck this and add Advanced uh in advanced script you will put it as error message so that it comes in red color and you want right now about it right so what is the equivalent script translation for abouting is current wherever you see a word called current it means that it represents the current object current record and there we are you know giving a function called set aot action and Boolean true so for this you don't have to worry you just have to put current dot and and it list Downs a list of uh methods that we have so uh you know it gives you suggestions right away so it tells you right sets a flag to indicate if the next database action is to be aborted it could be an insert you're trying to in abort an insert action or deletion action or ABD action whatever so you have to set a flag true or false right it says there also it helps you saying that you have to put a Boolean Boolean means true or false right so this will help you out uh if you remember uh you know you remember in client script I was telling you g form dot so anything like Glide form that API is used for client script G form. getet value of G form. set value of G form. clear value uh g. add option g. add decoration and all of that like that in business roles it is all about current dot current dot current dot right so current represents the the specific record that you are into so here in this syntax also if you see current comma previous right um You Remember a non-change is telling you old value new value like that what old value represents is previous value what new value represents is current value so the same difference in understanding you just translate it here so where in client script if you put old value here you have to put previous in client script wherever you're putting new value here you have to put current right so I'm saving This Record let me just make sure everything is right all right we'll refresh the screen before we could test right this is a critical uh incident and I'm removing the assign to saving it I'm expecting this to um show with the red uh error message and then it says invalid update right and because the say form is not saved because you have uh you know set an about action for this particular updation of record now um same thing you can do it like before insert also so before insert assignment group is empty so here we're trying to do before a record is inserted just want to make sure that any P1 that is created before creating we have to make sure that assignment group is not empty so how do we make sure assignment group is not empty uh we will put like whenever assignment group is empty we're going to say no you cannot uh keep an empty assignment group value for P1 and we will the action they will not be able to create a P1 so in order to create a P1 it is important for them to put the assignment group mandatory right so you could uh bring out actions like this and I told you an example for insert update right so before deletion of a record also you can just keep some uh you know validations like if this record is so and so do not delete aot action you can keep or else you could uh you know print a log in some logs table anything like that that is with regard to insert update and delete between before and after any doubt any doubt with regard to before and after insert update and delete right so there is something called uh asynchronous right so what is asynchronous is after update an ASN asynchronous business rules are same then what is the difference between after and asynchronous that um after Works um like exactly after record is updated asynchronous is like it will be like you know slow it will run slow then what is the point of keeping a slow script is because let us say uh you have an incident um so once an incident record is created you want to send in 100 emails to 100 people right so that is a long process right so anything that you identify or I'm your process to the system is very long both are nothing but one and the same just that the difference is after update the operation will happen happen right away in the fraction of second but I think it will take like 1 minute or 30 seconds based on the length of the operation um if the logic is hello yes please yeah can you repeat the testing again because my internet was all right after update and a syn are same after update after update and a sync are same except the word suggest right asynchronous means like uh it is not a u it is not a concurrent action but it is like a consequent consequen action meaning it happens right after an update like um I see um U like when you will uh there will be a requirement that whenever an incident is updated you want to send 100 emails to 100 specific people for example let us say P1 okay for P1 you wanted to if there is a P1 and that P1 is related to um desktop right uh desktop or Internet Internet you want to send an email to all the individual users of the affected location right not like one email like if there are thousand users you wanted to send thousand emails if there are 2,000 users in user table you wanted to send 2,000 emails because uh once a P1 see imagine you are in a company and there are 10,000 employees working uh in a specific region Hyderabad region and uh there is a P1 created there's only one ticket created and there will be some one or two teams governing that incident or working on that incident there will be only one caller in the incident like we cannot encourage like 10,000 people also being the caller right so so but we know that this issue is kind of uh uh affecting this entire uh uh building entire city something like that so once that incident is resolved you have a requirement that you want to send an email to all the active users um of that location for which the incident is created so if you look at incident there will be a field called uh you know location or uh probably callers location so callers location is what location field is not appearing here but let us say say you know the company zme North America and it is in a specific region so we need to identify who are the other peoples like how many other peoples in the same region we have we have to send them a email stating that hi everyone the you know the issue has been resolved and the system has been restored back to normal so you are expecting like 10,000 emails or th000 emails that's that is a large volume right at this point definitely you should not put after update business rule instead you have have to put after aing business rule the conditions will be when to run is the table is incident table when to run is priori P1 State changes to resolve and uh category categories like laptop issue or any specific you know um Network issue categories Network issue in advanced script of the business rule you will give it like you will Glide record you will Glide record all the users mapped to this specific company all the users mapped to this specific company and sharing same location as this incident caller and you will trigger notifications to them this is the requirement imagine at this time there is an expectation that there could be th000 emails 10,000 emails right because because and uh based on the volume of the users you have on the specific location so at this thing at this place is important to uh put an as business rule otherwise there's a possibility that there could be a system slow uh because when you put it as after update like system will be rushing to do that job but when you put it as sing system will take its own Slow Time meaning it will not take like hours and hours it will take like 2 minutes 3 minutes but if you look at the database levels and nodes level that 2 minutes 3 minutes also makes a very big difference so uh that is a typical use case where you could put a uh this kind of a uh you know a sync business rule should we go ahead and you know possibly write up this requirement status resolved category is Network right so um there's a P1 created on an specific location uh and that has been resolved so what you need to do is P1 Network resolve email okay so the syntax is same so the logic is that see email to all users sharing same company as the incident caller all right what do you need now you need to go to the table of incident table so in incident table incident table is the same place where business rule has been written you need to identify the caller company so caller name is nothing but caller ID so how do you get the caller ID is current dot caller underscore ID so you don't just require caller ID but also you require caller ID is company right so you go to company field caller id. company right company so this value will store in a variable called where comp where comp is equal to my current records my current incident records caller ID is company right now what you need to do is you have to go to an user table and look for all the active peoples look for all the active people who share the same company for example in this case the company is uh Acme North America we have 143 people which is a quite a large uh thing um in North America also we have several locations right so let us see what is the location of this guy Gerard okay so instead of choosing uh company let's choose location that will be you know even more better you have 14 fine this looks decent so current. caller id. location okay now what I need to do is uh send email to all the users in the user table sharing same location at the instent caller now what I need to do is I have to Glide record incident table first sorry user table first step so what I can do variable gr is equal to new Glide record of sore instead we can say where tab right okay okay is this fine space tab oh like yeah you can put tab the space Oh okay okay you're saying this one yeah yeah yeah yeah shortcut right yeah so we're going to use a table and in user table we're putting up a filter like um location is is this one excuse me location is this one and then you are definitely expecting multiple records to be there so you'll put while right so trigger email so for any doubts okay now let's see how do we trigger email so to trigger an email first of all we need to create an email let's create an email right away I have to go to U you know notifications under system notification you have system notification module under that you have notifications so here I'll go ahead and create a new notification okay so um this notification is also uh you know for the incident table right I'll give the same as name as business tool doesn't matter and it ask me when you want to send the email when a record is inserted or updated so we saying that oh when a uh I can directly put it as when record is inserted or updated and I can put updated and I can put whatever filter conditions I kept it here right so instead of writing a separate business rule I can write it right away here but the problem is is um you know in the same place I will not be able to send it to 100 peoples right because I need to identify who are the peoples so because of that requirement I need to change it as event is fired event is fired this this conditions I'll come back again so we are going to trigger an event from business rol that will in fact trigger a notification for this we need to create an event so how do you create an event is you have something called event registry create a new one on the event registry an event name so you'll put it like P1 resol um P1 want resolve network network right and this is going to be running on my incident table so these two fired by and description are like for your developer documentation like uh for easy access so we'll put it like um via br br means business Rolle you paste it up right and save this so this is the new event name that you have created after creating a event name refresh your notification form so that it gets reflected in the um event name dropdowns I'll just look for P1 resolve Network here so I can find P1 resol networks I'm done and I need to identify who are the recipients right let us hold hold on this let us write the uh who will contain what it will contain for so wherever I put like dollar cly bra and all those are Dynamic Fields U you don't have to worry about that if you know the back end name just put dollar curly BRAC and put the back end name if you don't know the back end name you can go and find it there otherwise the shortcut is to choose it from the right side variables that you have so in subject we're saying that the number incident number Dynamic number P1 has been resolved and in body we're saying that you know we're giving the number uh details short description details resolution notes and you could keep on adding how many hour you wanted which is fine now we have defined when to send and what it contain now the biggest question is who will uh receive it right how do we handle this is right now um going to use a table so all these users are the people who going to receive it right now from uh okay see it says that when to send this an event is triggered this when this p1. resolve. network event is triggered now who is going to trigger trigger this event who's going to trigger is our business rule is going to trigger so the Syntax for that the same is gs. glid system do event Q right it gives you like you know a syntax how to write that as well if you see name which is in string and then the record uh you know uh name is this name the name that we created for this event name command the record so the record uh if it is uh incident table you have to put it as current but our places it is user table right so uh if is user table you have to put gr gr represents user table and current represents instent table where it was created now this event also we created it on instant table uh the event also we created on instant table and notification both we've created on inset table so we have to put current because when we put current it represents incident table because the business R itself is written on incident table now there are two parameters that you could pass in your syntax as part of your syntax param 1 comma param 2 so in Pam 1 and Pam 2 you could put anything that you want to in our case we're going to put the uh this user right this user S ID gr. C so what is gr. ID it is nothing but this users uh users ID or else since this requirement is about the email you can put gr. email also right and param to um you could just leave it empty or probably you know for name sake you put you can put it like gr do current. number now so the Syntax for event is uh you put the event name comma the object the table object so you could either put it as any Glide record object or the table object but since we wrote the event name and the notification on incident table incident table is here right so here represents current so if we put it as current comma g.s g. is nothing but the soci of your user record and then the current number meaning the incident number so through this your uh your event will be triggered which in fact will trigger your notification now here you have something called param 1 contains recipient param 2 contains recipient right so I'm going to I'm going to enable this param one contains recipient so what happens is this is my parameter one right so each time it goes inside this Loop the one one person C ID will be pass here so everybody will be going to send a receive a separate separate email so I will enable uh even param one contains recipient so I'm going to save this up so this one it is important for me that I put it as a sying because it is going to I know that it is going to you know trigger probably 100 emails 10 emails so there is always a potential of larger processing so I would use an syn business rule instead of an after update business rule here so let us test this specific functionality all [Music] right let me close uh all other not required columns Let me refresh the form as well so I'm going to this instant form I'm going to resolve this so when you resolve few fields are definitely mandatory right so let's save this up right now that we have saved it so we definitely expect uh you know bunch of emails to be tried so how do you validate the email is go to emails module in the left navigation okay the emails that we are expecting has not been triggered let us identify why oh the category should have been resolved okay see the category should have been network uh but this category is uh hard let us again update the record let us reopen this priority P1 status resolved category is Network all right so let's put it as Network save this now if I resolve it should be triggering my email saving this okay now that I've saved it let me you know refresh my emails [Music] again okay so uh all the short all the subjects of the email should starts with the number that is what we have kept right so we could see that 13 other people received this email these are the 13 other people you could see that in the recipient's name and let me click on right click and preview email to see one sample record how the email body is so the email body is like this the number short description resolution and the additional comments right so you got this requirement any doubts in this one can you again explain about event H so in this specific user requirement we're trying to combine events notifications and business Ru right so an event can be triggered from any server sit script scripts so once you trigger an event you can do any server side actions or else just a notification also so you create an event on a specific table so in terms of event table only two fields are required important even name and table rest all this fired by and description and all is for developer documentation for easy understanding so here we created an event called P1 resol Network and which resides on the table incident so in notification we are saying that we need to send an email on incident table whenever a specific event is fired what is the event this is my name right uh who is going to receive the email so whatever event is triggered right that will have two parameters by default it could be empty parameters or it could be stored with some value so in that you have parameter one you have parameter two with parameter two I'm not doing anything just that the parameter one uh I'm stating my system that hey parameter one contains the recipient like who should receive it okay this has been checked and what it will contain it's just a simple one like you know you're trying to bring in the fields of the incident record and populate it here now we have a notification defined we have a event create now who is going to trigger your event is the next question so who's going to trigger my event is I written a business ruol business ruol means it's a server side script like the business tool will run so we saying that after update so after update asynchronously asynchronously uh when these condition satisfies process my script so which condition satisfies when priorities P1 and state changes to resolve and categories Network at that time alone what you do is go to user table and uh put up a filter that identify the people who belongs to my same location meaning my current records callar ID is location same like that how many other people do I have identify them and there's possibility that there's going to be more than one record so put a while loop and by while you identify each one of these records uh trigger the event so the syntax to trigger an event is gs. event object the table object so since we are uh we have created the event on insent table we want the object also to be incident so instead of putting it like incident you can put it as current because current itself represents incident table right because this business rule is written on incident table and then in notification we said that we are going to send uh the recipients in parameter one so this is parameter one this is parameter 2 this parameter 2 I'm sending the incident number but it's like you can leave it empty also because anyways we are not using it anywhere else but parameter one we gave information to my system that hey parameter 1 is going to contain the recipient so every time like this while [Music] loop will be fired and which in turn will trigger a notification I will show you one more thing event logs okay event logs so whenever an event is triggered it will contain and will do filter uh you know created is2 a to look at the recent ones so this is my human name right p1. resolve. Network so you could see that 14 events has been triggered and parameter one contains what the Society of the um Society of the user record second one consent contains the current do number which is nothing but the incident number so you could see that parameter two everything contains incident numbers parameter one contains SIDS these cids are nothing but this user table cetes meaning specific user records societ like this is iel tutors this is somebody Abraham Lincoln like that there are different people their socities are these records so this is a log like for example uh if at all while demoing it to you if I find that event was not triggered or something what I will do is I will just uh look at my event logs to see whether an event is triggered or not if there is any issue here then I will go and debug why my email was not sent anything but right now I do not have any issue with my email so I don't have to check my event locks but I'm just showing you in case if you have any issues that it did not process email did not get process you need to understand and identify whether in even stable do I have an entry or not like was this first of all even triggered or not then you can see whether notification ised or not right these are consequential actions one after the other right any doubt once open the business business rules script scpt so the GR in 12th line and the GR in sth line are both same right correct yeah so after this line number seven wherever you say gr gr it represents the user record see out of my habit I'm putting the name as gr you can put it like uh USS and uh but you have to make sure you know everything it's USS right any doubts your voice is breaking no more doubts thank you all right okay so with this we'll have the session closed for today and tomorrow we will see um query and um yeah we will see query and uh uh display bus right so display business R is something that has to do with client script and stuff uh so we'll look at the query business rule and uh display business rule tomorrow I have one more question yes please so instead of selecting as sync what if what happens if you select update not after okay you put s after update right it will work absolutely fine not a problem uh but in this case we are 10 records right but imagine 10,000 records are there or imagine 1 lak records are there in the user table sharing same location at that time what will happen is for everybody using service now for a fraction of seconds there will be slow in the system like even though you have a good Network the system will be like little slow because the load you give to the system is very high right and you're telling the system you're giving an command to the system hey do it right away right after my update right you're not giving that breathing space for the system to process the information just saying Hey I want this right way to happen so if it 10 records absolutely fine it will not have any problem but if it is more than uh you know 10,000 records One lakh records it will be a problem and imagine you are Developer one I'm a different developer and somebody else is a different developer you do same like a you know like you put you think that okay only in my case I have some 10,000 records let me put after update only so you'll do that and I am getting a different development work on a different table like problem table I'm doing same mistake and somebody else is also doing same mistake what will happen they say right small small big uh small small mistakes Mount up to a you know Mount up as a big one like that these small small small issues will Mount up and it will cause system slowness so these are best practices you I would say you got it right but it will not be a show stopper like it will not work or it will completely down the system nothing there will be very small uh processing slowness but why would you want to give a chance to that right as a part of best practi is also uh when you are very certain or very sure that the script is going to take a long time because you're processing multiple records better to put after resing business R and it is not urgent right you want to uh you want the uh update to be happening on the same second you're okay to wait for like 10 seconds 20 seconds right it is not going to take anything more than 1 minute like even if it's one lakh records it will take like 30 seconds 40 seconds only that much but I'm saying that time breathing space at least you have to give to the system for that better to put after resing business I got it all right yeah so you guys uh make sure you Pro you know practice this complete script include and this partial of business rule and in all your practice section uh may make sure that you use a Glide record you know the more you get habituated with glide record you will feel confident to handle the system so Glide record and glide jacks just keep practicing that and tomorrow we will look at the display business rule and query business rule with that business Ru should be done also tell tell admin to provide the updated PDF sure can you just put the message on this WhatsApp I know the training group so that it serves as a reminder to me as well yes sure all right uh so to raheem's um uh if people on the other call I mean on this call if you look at rahim's question in the group so he was saying that he trying to add the function still no uh use or something right so if you look at line number five in WhatsApp screenshot he has put something like Gore form dot get value of particular customer and he's validating the customer in fact like he's checking whether the customer is Daniel zil right but if you see in catalog item usually user field we will not keep it as single line text it will always be reference so when you put it as a reference what happens is uh when you try to read the value it is nothing but the S I mean you try to read the S of the value it's not like a free text so here you have a field called um on behalf right so let me show you when you try to do uh you know you give an alert and try to see that what happens okay so this person is right now system administrator right now what I'm trying to do is see there's two way you can run a client script one is like properly write a client script and put an alert the other way like a developer method shortcut is you use your keyboard shortcuts Control Alt shift J right so JavaScript executor opens up I will put that as a note for you control+ alt plus shift plus J so uh this opens up JavaScript execute which helps you run any client side codes right so now what I will do is I'll put alert Gore form dot get value of the back end name of this field is onore behalf okay so I'll put onore behalf I can put it like like this so you could see that you know it shows some 681 6 something like that this ID right so if you try to identify what that is it is nothing but it is a sid of the specific user record system administrator right I'll show you so I'm clicking onto the system administrator and I'm jumping into profiles so you could see that 6816 6816 479 right so it's a this ID of this particular user record so likewise you got that only 6816 F7 right same whereas if I try to you know print request type request type is drop down right so what is the backend name of request type req okay requestor type let me print that that will show me proper Stringer like text get value of requestor type okay right now we have the value as none hence it is showing like this let me switch it to like this okay I'm choosing request for self so now I'll try to print uh uh show an alert message of my request type now you would see that it is self but in fact here it says request for self right then what is the difference between request for a self and self is if you look at this variable this variable has two things one is um uh one is front end value the other one is back end value what I'm doing is I'm going to this variable right click configure variable okay so there I can identify that it is a select box and you have a front end text and a back end value front end text we kept it as request for self and backend value we kept it as self right so that is why when you try to put an alert it shows only the back end value not the front end value clear all right if this is clear U I'll be able to uh uh get into our actual session for today any other questions before we get to the actual sessions um I will tell you what we're planning to cover today in business rules uh you would have already seen um okay let me tell you something in searching right you don't have to type like business space rules and all if you want to look for business rules uh like business rules spelling is like business space rules right so you just put Yes Yes means the ending word of the ending letter of the first word space and followed by uh the second word full text full text are just you know like this I'm trying to say that for in order to search like like uh you know uh maintain items okay so we used to developers used to put it like this n space it it is no shortcut it is nothing but first word last letter space followed by starting of the second word right I just put n n space it so n represents maintain or anything any first word finishing up with the letter n and then the second word starting up with the letter it so I'll get like this all right so I was telling about business rules right I'm giving you this explanation because you shouldn't Wonder like okay she's typing s space rules how this is coming so the logic is such that uh last letter of the first word followed by uh you know the second word so I'm going under system definition business rule looking for the recent updated okay so the other day uh we were uh you know discussing about before update before insert after update after insert and async business rule right so there were two other components that we have not yet covered in terms of business rules that is uh query business rule and the other one is display business rule so let's look into query business rule for today I have kept few uh businesses already open in screen uh these are developed like you know not by us but out of box it was already there in the system so let me explain what this is so the name they have given for the business rule is user query and it runs on the table isore user let me close everything else okay okay so it runs on the table cisor user right so I'll go to cisor user. list first of all so before querying querying means like looking at the records right so system is telling me that actions nothing is defined in advanced system is checking for the first level of condition if the session is interactive why this what is this keyword interactive is nothing but there are two ways you could access a record right like probably in an API like in a web service call A integration call you could try to access a record the other one is like in an interactive session like this right in client site like you sit on a laptop or some Pro system and then you look at it in the screen which means that the screen or the session is interactive so this represents that people are not accessing from web services anything people are accessing on the screen like on client side that is the meaning of is interactive all right and if the logged in person gs. hasr admin means the logged in the Glide session person has the role admin admin not right means just the Ulta of whatever I said now um the person does not have the role admin or the person has the role user admin right so if you don't have the role uh admin uh uh and you have the role user admin at that time what happens is people will be able to see uh the records uh that are only active is true which means that you will not be able to see inactive records so let me filter down like that active is equal to false okay now I see one record in the entire system right let me deactivate two more records like I will choose two more records to be deactivated show matching so there are three records right let me impersonate some itl user so there's one account called itl user this person has proper itl roles I will choose this person itself after choosing this person I will just refresh this or refresh or duplicate the screen you could see that it says no records to display right and total records it shows is also 9:30 to and if I filter out the active you can't see any other records which means you can't see any false records like inactive records you can't see the reason is because of this particular uh query business Ru let me turn of this okay I'm disabling this and then again impersonate the same user okay this one got saved properly now I'm going to impersonate the same user now I can see these three records right so you understand that whatever was stopping is this particular uh business rule so with this understanding I'll tell you again so what this script is looking for is before you try to access a record like you're trying to query right query means like looking for or accessing right in another language so before even looking the record system is evaluating whether the logged in person does not have the role admin right the it the itl user we chose right this guy this person this person did not have the role admin condition satisfied or the person has the role user admin either one has to satisfy so this since this person satisfi the first condition he will be able to uh satisfy uh you know to move into next step meaning accessing the script the script tells me what current current represents the table that you defined here in the current Table they will be able to see only the active query records right only those records they will be able to see so that is the reason uh you know this person was not able to see not only direct records let me tell you in another way let me take you to insurance excuse right now we are in Self Service view only the only because of that we are able to see few felds let me switch my list view to default view so that I get access to multiple records so here um there are few records right let me open B Richman and Beth angelin what I'm going to do is disable their records user records like their profiles I'll disable it activ is false okay just B richman's profile I have disabled it now I'll do show matching now we have this business tool already activated so I'm going to impersonate this itl user guy right even in the preview of the record they will not be a but otherwise let us assume BD richment right so I'll put caller is B richment I'll do a MAG I'll click on the magnifying class I'll put butd you can't see any record right you could I can't even try to filter down to the user records you understand the difference now right since I had this filter already preset as an admin so after that after 2 minutes I impersonate as this lady itail user now if I refresh fine fine even then if I try to access the record and click on this B richment profile I will not be able to see the data because I have a query business rule that is stopping me to look at profile of an disabled person or inactive person now that's fine that is understood and also I'm trying to say that the role of the query business Ru is that you can't even look at those records in this search also like I can't just you know if I put B Richmond's name also I will not be able to find it if I put somebody else's name like who's active their names I'll be able to find so the these are the places you generally query right you know even in filters or anywhere you will not be able to see those records so this is a simple thing right you can either put it like U current dot add query [Music] um activ Falls or email is empty okay I have uh like 15 records wherein email is empty so let me do one thing let me change this logic of the script so I'll put it in a way that email is not empty like if somebody is not an admin or anything they will be able to see the records where in email is not empty okay email comma operator not equal to not equal to comma empty so I'm changing the logic in such a way that that the person who's logged in if they are not an admin or either if they are an user admin at that time they should be able to see only the records that are active also the records where an email is not equal to empty right any questions with the new query that we have added I will uh switch back to my access I'm going to save this configuration that we have done email should be right um email should not be empty so I'm saying that people who are not admins right not this means not people who are not admins or either has the role uh us admin this represents R right this pipeline symbol represents R and double ENT represents and okay yeah this one represents and so we the condition is uh did you did you write the condition or it was out of box condition it was already there so instead of this you could just you know um you could put it like in conditions if you could bring it fine like in filter conditions if you could bring some default like um in user record if you could bring it fine but uh we are trying to get the access of logged in person right uh this filter condition will be a able to uh uh fetch only the fields of user table right like activist true uh email phone so all these fields are uh relevant to user table but if you want to identify the person who's trying to add the record it he can be someone else right you wanted to check something else other than the fields before evaluating then you might have to end up putting a condition like this so if you put a condition like this what is going to happen is only if condition satisfies it will go to script section otherwise it will not go so your syntax uh uh is not fine so what I'll do is I will put it here so that you can understand the curly brazes and everything so together system is checking if the person does not have the role user admin or the person does not have the role admin they should have at least one role if they do not have both the roles then what will happen is right so if you look at this bracket this entire bracket before that only this not is there so you have to imagine in a way that this entire condition returns false right because I'm putting a negation here a not operator here so if uh the screen is interactive and at the same time this entire condition is not satisfied not satisfied then follow my script now my script what my script tells me it tells me that so people can satisfying this condition will be able to see only the uh active queries active records active records of this table this table represents current and also email is not equal to empty only those records you'll be able to see that is the uh script we have kept okay so now that we have saved it I will try to impersonate the it user again I will refresh the screen so here I'm trying to choose 100 records uh per row okay so what we will do is we will either change it to encoded query active is true and email is not empty we'll run this and we will copy the encoded query and we're going to paste up here current dot add encoded query right saving it now ID tell us sir I'll try to put a log to understand if uh this condition is satisfied let this get saved okay this condition is satisfied hence it's going to this uh thing [Music] e all right so what did I removed the complete condition which means that it's going to apply for admins also so after removing this condition I just reloaded the screen so I'm able to see only one record the reason is because in query I have set in a way that uh add query email is it admin example.com so what happens is I'm able to see this person record only uh now I will restore this condition again I'm going to save this up and then let me impersonate this IDL user person I will refresh the screen again so I could see that there's only one record being available right reason is because um we had modified the query such that you know show only the records wherein email is it example.com it admin example.com so you could modify your condition according to your requirements uh so the importance of query business rule is even before uh the record is fetched from the server it will do a validation whether the logged in person condition satisfy the condition and all of that only after that it will return the output right you could see that in personation okay I'll tell you why we are not able to do end impersonation um reason is because uh so we restricted the privilege of admin to look at other people's account right so in order to end impersonation you have to impersonate to your account now you will not have an have access to your record so that is the mess up we have done so the only option right now we have is login. do and relogin again okay now let's go and you know change the script as soon as possible you understood previously why I was not as as even an admin I was not able to impersonate the reason was because I did something like this like I removed uh you know if the person is so and so they will not be able to look at anybody else's record except for this record so what happened at that time is as uh itail user I was not able to even see system administrator user which resulted me that I will not be able to impersonate back to anybody else's account except for this person's account right so so we will have to be careful when playing out round with admin access all any questions with regard to query business rules and what is the use and uh uh where do we uh actually require query business rule so you have a requirement where in they saying that can you please explain about the condition okay I'm copying this and pasting here because only then you will understand the syntax GS represents Glide system okay using Glide system you could get multiple components like uh uh you could get user object you could get session you could get Glide date and time anything anything of the current uh uh system values right so the GS API gets you everything in that you're trying to get only the session to see if the session is an interactive session or not right what does mean by an is interactive is there is two ways you could access record generally right one is through API integration web services call and all of that the other way is like how we doing right now like I'm in the system I'm interacting with the system like putting up a filter manually you know using keyboards and doing stuff that is what you call it as an interactive system system can identify if uh the records are being seen U you know seen from web services or from uh user interaction how it will happen user interaction is there's one table called transaction logs okay system logs transaction so there are some people in the market who uses proxy right uh proxy hasn't like uh they will share their credentials like you know they sh they will share their credentials with somebody else you might be in the US and somebody from Hyderabad could work for you so at that time you will have to be careful that you should don't share the credential instead you know if you require some uh uh help from somebody from other location you don't share the credentials of yours which will be against your company policy you always uh connect in a zoom session or webc session and uh uh you know share your control your machine control to them and they will be able to operate I'm trying to tell you why you shouldn't do is because in service now anybody anybody who's an admin role can see uh let's say I'm a system administrator right my profile is system administrator my name is system administrator so I can see from which IP address U uh lxmi has logged in I can look look at this IP online I will be able to find that it is logged in from Chennai and all of that so if I impersonate uh not impersonate like if I access raheem's credentials right so I will be logging uh from Chennai using rahim's credential if somebody wants to track down right so they will just go to transaction show matching Rahim and then look at the IP address on online they will know that oh this was locked in from Chennai there's a difference right you shouldn't share your credentials this is personal instance you're doing development and all of that f so once you join your organization if you need any technical help or something don't shade your credentials just sit with them in a WebEx and get your help sorted okay okay now I will come back uh to our query business rule uh why did I jump is because we were talking about is interactive right so system knows from the transaction logs uh these transaction logs will be actually printed only when people are trying to access the data like in screen if it's through web services some Postman rest AP call and all of that you will not have transaction logs like this so system knows which device you're using yeah I think yeah it will tell you what are the device that you're using and all of that IP address yeah Windows right so and which browser so all these data is available in the system for anybody to access who has admin role like your PR developer also will be able to look at the these data so so system also knows whether the session is interactive or not and when system identifies that session is interactive and this double ERS represents and okay and this condition this entire condition I'm clicking on this bracket parenthesis you could see that this entire parenthesis is not right so so this entire condition is not satisfied at that point it will run into the script otherwise let us say the condition does not satisfied it will not even look at what is there inside the script it will stop right there now let us see what is there inside this parenthesis in parenthesis I'm telling somebody has a role admin or this pipeline symbol means r o r okay or the Glide system Glide system means like Glide system logged in person has the role called user admin so they people have to have one of these roles if they have fine what is a DOT is interactive means I mean what does it mean okay is inter active is one of the uh functions of Glide system let me show you there are several Glide system apis you have like gs. getet user gs. getet date and time gs. get session like this you have several apis among that among them is interactive is one of the functions that you have as I told you is interactive means I'm repeating this again again let me know if you don't understand okay it's interactive means like somebody's accessing the system real like not a bot not a bot a real human is accessing how do you identify whether a bot or a real human if somebody I told you right when there is a transaction logs available in the system it means that it is a human human doing it um if it is through rest web services see without even logging into some screen you can access few records isn't it through rest API there are several sources of Integrations and all right if somebody is trying to fetch that record through that way it means that it is not interactive if somebody's sitting on the screen and doing things you know like on client set it means is interactive clear let me know if there is a question on that okay so um we were talking about uh you know Glide uh apis right so you can see Glide record is one of the API Glide system Glide system means means GS so Glide date and time all these are the apis what I can do is I'll tell you um okay I will share a few things to you um generally if I put it like this right if I put it like this I'm look at the links kind of links I'm getting I'm getting service now and non service now also I might get it right like for example let me say user access if I go Google search user access what Google will uh give me results it will be give me it will be giving me uh results across any uh you know any folders right not specific to service now but if you want to read something specific to service now on user access what you'll do you'll put user access space service now this is how Google search work right now you have a custom search engine uh which was developed by you know um a web called SN gurp so the these are people like uh you know who develop communities so they developed a custom search engine uh I used to bookmark like if you can see I have a bookmark of that what it does is now the same user access keyword I will put it here and you can see that whatever result I obtain everything is from service now only I did not get anything apart from service now so it helps you save time uh to filter down to the documents that we are looking pertaining to service now only what I'll do is I will uh give this link to you guys in chat so you just make a okay is my voice not audible now I could see rahim's coming saying it's audible but can you post that in WhatsApp group um sure for now I'll just put it in my notepad okay and I'll put it in the WhatsApp group as well but for now I have sent it in the um this go to meeting chat as well this is one thing I wanted to share and there's another thing um so you have few communities like this for example let us say you have a question now and what you're doing is you're asking me that question right hey lakmi I have have a doubt and this is not working so you have a you have a community in fact I know service now Community there are so many developers like uh uh they will answer to your questions there are WhatsApp groups and all of that right like that we have a proper Community if you see that this is my community dashboard I'll send this link also uh in uh WhatsApp I want all of you guys to uh you know uh to register in community what will happen is going like after 1 month you require a help in a script like you're writing a script and it's not working okay uh it could be a simple thing or a big thing doesn't matter you just have to detailly put your question uh in this community so you have to post a question and definitely some of the other people will answer you now coming back to the point of why people are answering is because um when each person answers they will get one credit points so in service now you have a concept of uh uh service now Community leaderboard so service now recognizes people um people who help other people right okay okay this is partner wise leaderboard but if you look if you watch your LinkedIn properly like uh people ask questions right now uh like let's say you know Rahim asks a question why do you think I need to answer because um I'm your trainer I'm obliged to answer you right but if it's from somebody else why would I have to spend time to answering them that is another question right so you would have like lacks and lacks of questions posted every month on this forum like every day there's nothing less than 50 questions posted on this forum like uh people will be asking like um you know few questions like this how uh few proper questions see how to ID a submit button and uh uh what is that uh not Mark attribute like this people if they don't know anything they will definitely ask here so somebody's asking how to add a button in the email notification so if you look at this this was posted 1 hour ago and somebody responded to it 33 minutes ago now why do you think mkes is so much interested in answering them because he's spending some time in this right is he going to get money no what he will get is you will get points like if I look at Mukesh profile you can see that it says Mukesh is service not developer and he has 280 points so what service now does is the more the people has points it will uh uh it will develop a leader board like people having like 10,000 Point 20,000 points uh every year they will be getting goodies from service now and they will be highlighted in service now website like oh these are our community uh developers right you get that recognition so for that people try to uh be very active in community portals and they respond to you so this suggestion I'm giving you that in future if you join any WhatsApp group I'm good like uh uh there will be people for you to help you know if you need some help for free something like that otherwise also you have Community forums you can ask questions and get your answers but you can't expect the answers right away right it is going to be like um you know a bothside help so you'll have to wait to see this guy posted 44 minutes ago you got it like 10 minutes later so like that people answer back to your question so look this question was posted one hour ago and still nobody responded to it if I know the answer for it I can respond and if they give me a thumbs up I will get one point so this work like this I have put this community link as well and um yeah so um I would want you to have access to these two things and of course uh developer. serv.com through that only you logged in this right uh you also have access to lot of uh um lot of um documents developer documents as well so that will all be really helpful for you fine so we got a little deviated uh let me come back to what we were explaining uh previously yeah so this is interactive question is it is that answered do you have any questions further to that all right I take that as a no so in the meanwhile I will also tell you um what this vers is about right so every time you click on something and you save a button at that time a new versions gets generated right now I'm in default update set like I've not created an update set let me change it to U you know TST Dev v3.0 so what happened is every time I saved up a record it created a version it could be in a default update set or it could be in a proper update set doesn't matter uh if you open up these versions right let me open up this one okay when I open up that one it will have a payload XML it will tell me I'm clicking on this place okay this XML orange button I'm clicking so it will tell me what it was originally like it will tell me in like xmls you know the XML parameters there was a field called um description there was a field called condition wherein this was the value put and There Was You Know Field called Script inside the script we had current. active query so all these you will be able to see this year like for example let us say for the same business rle 10 developers are working you don't know like exactly two minutes two months back two months back who updated this and U uh based on who's updated and what was the exact configuration change happened right so if you want to identify that you have to look at the versions and identify okay what was changed now you identify that like you know this is the proper version like uh 1946 right the timing is 1946 right now we are 24 so you identify that okay um we need this is the correct version these are all is like incorrect we need to switch to this version so what you have to do is you have to open that record and click on the button called rever to this version so let me tell you what are the links we have we have compared to current show related record reward to this let me duplicate it unpin let me duplicate this two three times I will C on first link compared to current so it will give me a proper comparison of the code before what was it and now what was it like that so that you could we disabled it no from here and we currently have it like this right so you are able to see the difference in the code using using the related Ling called compared to current now you could take an action as in you want to re revert means what like switch back right revert means switch back you want to revert to this version or this merge is nothing but like instead of going to this version and instead of going to this version you want to go to this updated version right like you're changing few fields and then clicking on Save merge means okay I have modified few things and together combined I want to uh have it in my system at that time I will give save much otherwise if I want to go to this exact version I will click on reot to select version right and now you have this button called R to this version I have already explained you the moment you click on to it it will go back to that previous version nothing much and if you click on related record nothing but it will take you to the query business tool because the name itself says show related record so the related record is this only so it will take this is that clear any doubt so far so when do we use this query business query okay so I have another example I told you right see um for us a table what was a filter only if you are an user admin you have a role called user admin or you have a role called admin ADM which is a you know super super super admin Ro only if you have the rooll fine but if you do not have the rooll then what are the records you will be able to see you will be able to see only the records that are active is true right current or add active query uh what is the use of this uh query you're giving instruction to the system that people who do not have either admin or or user admin role will not be able to see inactive users records right because in an organization there could be 100 people joining every day and 100 people leaving maybe like in a big organization there are possibilities right at that time inactive records are going to pile up like if you look at last 10 years there is going to be like 20,000 inactive records why would you want to show your users right your peer employees disabled records why would they want to track down the the exist existing database right in Outlook will you be able to look at existing people user records no right you will be able to see the people who are only currently part of the organization similarly in service now also we want uh normal people we want normal people to see only active records not the in inactive records uh so the inactive records are only accessible by admins and user admins so that is the requirement is that requirement clear like I mean business wise logically does it sounds right to you yes now uh same query business rule I'm showing you an example where they've applied in incident table right now uh who do you think should see the incident let us say um let us say uh you know um Mr uh uh Mr John raises an instance stating that hey my laptop is not working working who do you think should have access to like I am I am an IT user itl user is somebody who can work on a ticket right I can have access fine and apart from that John can have the access because John is a person who raise the ticket he can have access and people assigned to that uh ticket can have access and people uh members of the assignment group can have access fine but who else do you think should have access to probably John's manager that much only right you don't want to show John's incident or issue related stuff to any other people isn't it so let us say that is your requirement now what we going to do is this is an existing script I will just read it out for you what this means this I'll explain I'll come back hold on so we're putting a filter on current current Table is nothing but incident table in inent table we're putting that caller ID caller uncore ID means nothing but that caller field right in incident you have a field called caller if you do a right click you will see that the back end name of that caller field is callcore ID so that caller uncore ID is u u u is there right alphabet u u is nothing but logged in Glide session logged in person's user ID which is nothing but right now for me it is my S ID my user administrator S ID this user administrator this Ida okay adding another or condition either this condition satisfied or opened by in incident table you have another field called opened by opened callar you have another field called opened by it is not there in the layout let me me bring it opened by okay so the logged in person uh should be belonging to the caller field caller field otherwise um opened by field otherwise there is a field called watch list you have a field called watch list right so uh if I'm a login person I should be part of this watch list I should be either I should be part of the watch list or either I should be the caller or either I should be the opened by one of these three conditions should satisfied for me to look at any incident I'm try right now trying to access incident 55 okay I should be Christian or I should be the opened by opened by home I system administrator right so I should be system administrator or at least my name should be there in the watch list one of these three condition should satisfy right is this line understandable line number eight and nine if this is so I will will further expand and explain to other lines right now this line will satisfy only for people joining into this thing okay so let us go one line after the other so first line is it says for run a function called restrict insence this one I can just put it like like this also but I just have to make sure that my test my function name is also to think that oh this is a keyword called restrict or nothing like that just I'm writing one script and I'm uh writing that script uh in a function name like I am putting my own frame of function name like can put it like this also so same name I have to call it here only that difference it is no keyword or anything keep that in mind so I am calling this function the moment script executes this one it will look like this control copy control F like this system will automatically do and whatever is between line number three and 11 that will start running okay now so uh whatever is line number between 3 and 12 it will run let me look at line number five so here it says that you always keep your curses like this so that you know this bracket starts here and this bracket ends here you will know to understand the logic so checks whether the Glide session Glide session logged in person has a role called it it not right so this entire sentence opposite meaning the logged in person hasr itl is false okay if that so if the logged in person does not have an itl role and at the same time and at the same time the person uh does not not not has a role called in snore incident role so there's another role called snore incident read so if somebody does not have this role and they also do not have this role and system identifies that the logged in session is the interactive session it's not like a web service or anything at that time whatever is there in this in this line line number five sorry six 6 to 11 will execute clear line number five is clear right any questions on line number five okay I take that as a no now you have something on line number seven so this line number seven is nothing but like whenever you when you over if you see an under line so what you have to do is you have to do a right click you will see show documentation or either you will see something called open definition if you see open definition it means that it is a script include and that link will take you to script include inside the service now but this one if I click here it says show documentation so as I told you we have several Glide apis right GS is one of the Glide API it's a Glide session API like that you have an API called Glide plug-in manager you don't have to worry about uh you know uh these things these things uh uh Glide plug-in manager and all will come only in out of box scripts uh you would not have realtime use cases to use like this so what this takes is uh there are plugins there are several plugins do I have a plug-in name called comm. snc SPM which is active and at the same time does the logged in person has a role service viewer if it is so return return return return means like don't put any filter that's all I'm good if not if this condition is not satisfied what it will do it will go to next number line number nine in nine uh instead of the name uh variable called U it is just populating uh it is just getting and storing the variable uh view with the value of the logged in person S ID after getting that system is restricting the filter that uh current current represents instant table instance table putting up a filter adding a query caller ID is this logged in person or condition opened by logged in person again an or condition watch list contains right because watch list is some field you could add more people like I can keep on adding 100 people also here right so contains the keyword called contains so only those records people will be able to see here do represented R in 10th Line no dot does not represents R this R condition keyword is there right that only represents R so this is like a concat uh see I told you add query add encoded query you remember add query means you put one filter add encoded query means you do a right click and copy query uh so this particular concatenation of query is an alternative to encoded query so this one is an alternative to encoded query so either you can put encoded query or you could develop a script like this with regard to service now anywhere like if you want to look at the syntax or anything you don't have to worry you just have to have the knowledge of identify the reference script so that you know okay the script is called where and uh you will be able to derive the syntax from that right so coming back to this plug-in so when I'm explaining this plugin let me tell you um left navigation you remember I was telling you how to activate a plugin and all of that so similar to how a field has a front end name and backend name plugins also have a front end name and backend name anything you you see in service now has a frontend name and backend name so the backend name is back end name of the plug-in is com. snc dosm let us look at the front end name the frontend name I assume is based on the commands SPM premium plug-in let it load we'll do a search here right I can filter Down based on the back end name that I know also so I had put comm. snc SPM so it tells me that okay so there is uh several plugins with this uh matching keywords so com. s.m. content com do uh no this I can't take yeah com. s.m. content this is this is the plugin so front end name is like um service portfolio management taxonomy content pack but the back end name is com. sncf right and again like other day I told you you will be able to categorize it based on to understand whether this is a free Plugin or a paid plugin like that in personal instances even paid plugins you could activate it not a problem it will not cost you any charge you can explore the functionalities of the paid plugins also in personal instances it's not going to cost you any charge but in company instance in production as I told you every company uh has instance is like for example if you belong to a company called techno uh technos uh technos script okay imagine your company name is technos script so they will have instance like technospot.net dev. serv.com technos cript stage. serv.com so uh service now also knows which is a production instance and which is sub production instances so for production instance uh if you activate the plugin they will charge you charge you means like they will not ask you hey pay this money nothing every year there is a license revision cycle right it is not visible to your eyes as a developer but management teams no when they send billing every month people send billing or quarterly or annually at that time they will run a report to see how many paid plugins have been activated and accordingly they will put it in the bill it's like a post paid you will know only after activating that to after several months when they generate a bill so I'm trying to tell you that if you want to explore any plugins you can do it in personal instance otherwise you can do it in company sub production instances but uh before you do it in production instances know the business understanding logic and ask them are you sure you want to do it right and give your management that this is the cost included plugin and if they ask you how much is the cost we do not have visibility to it uh there will be product managers for that they will take care of it but just as a developer you have to let your uh uh client know that this is a cost incurred right so any questions with this uh you know with this thing if not we will get into the next uh topic display business room all right so can I take that as no questions on this all right so let's all take a 10 minutes break and we'll meet again at uh 9:20 right so try to be back by 9:15 or maximum by 920 so we'll resume the session with uh query uh display business rule at 920 so display business rule is this one right this one so once you choose display the other options gets hidden so I will explain in detail query uh display business rule and and also some parts of the ACLS today so that is the agenda for today's session all right guys so I will um go on mute and uh we'll all visit back in another 10 minutes thank you hey guys I'm back all right so let's get started with the display business rule [Music] for display when when condition is [Music] displ [Music] for okay so these examples are not really helpful I will uh give you an example uh you know [Music] [Music] all okay so let us assume you have a field called category inside this layout right uh let me remove it from the [Music] layout so I'm removing the field category from the layout and saving it uh in instent form okay now I have a requirement that I don't want to show the incident U uh category field to the user but however I want to do some validations like for example um let us assume my requirement is that if category is inquiry or help I want to set my subcategory as disc let us assume okay this is the requirement now if I just put control L shift J and put like a variable X is equal to Glide form. get value of category I will not be able to get it reason is because I'm trying to run this and I okay sorry I have to put alert X so in the variable called X I'm storing the value of my category and I'm uh showing a popup of the alert message with the value that I obtained in the stored variable X right what do I get I get empty right the reason is because uh if you look at incident table 55 record number 55 if you look at at incident number 55 I can see category s inquiry or help but why am I not able to see when I run it it says empty the reason is because in the client side in the form it is not available right that is why you're not able to see it uh so let us say on form you don't have a value but however you want to fetch it from the server and bring it to the client at that time what we would do is display BR category okay let me put my name as like that and choose the table as incident Advanced true display display business rule and what I will do is variable X is equal to current dot category okay cput Gore scratch bad dot C is equal to okay so I'll tell you what this Gore scratchpad variable does so Gore scratchpad is a variable which will help you to uh fetch the data from server side and uh access the data in the CL side right but you will not require uh you know scratch Pad variables all the time only if you have a requirement that you don't see a value in the form in the form in the client side you don't see it but for some reason you want to validate it but at the same time you don't want to show it to the people don't want to show it to the people but you want to validate it at that time what you will do is you will retrieve the data from the server from the server means like from the backend backend means like business rule right because these business rules are server site functions from the database server or the table you will retrieve the data while retrieving you will store it in a variable like variable X like that y like that and access the data in your client script now if you put where X is equal to current. category and in client gr if your client said if you put X you will not get it you need to store the variable as a scratchpad variable this is the syntax one minute okay uh so you not just you know put it up in a normal script you have to declare it in a scratchpad variable so now let me show you how do you bring this so instead [Music] of glide. get value of category I will put gor scratch. category so let me save St [Music] okay now I shall open up my JavaScript executor and do you see I can see the value called inquiry right because this insurence uh uh you know the value is inquiry double five right ticket number five uh the category value is inquiry or help back end value of inquiry or help is nothing but inquiry and uh instead of accessing like in client script if you see always we used to put Gore form. get value off right that will work only if system can see that the client side but what we did is we removed it from the layout right when we removed it from the layout system will not be able to see then what is the other option the other um Glide ejects right if you want to fetch your data from server side there's two options one is glider Jacks which we've already you know learned about but if we want only specific field I don't want to process any information I just need that in that one piece of information from the same form then what you have to do is just a declare a scratch Pad variable in your display business tool and that same variable name you have to put it in the client site so once you put it you will be able to read the data right on a nutshell to tell you display business rule uh actually runs whenever form whenever form is displayed from the server to the client side from server whenever a form is displayed to a client side it will run and the benefit of this is you could make utilization of your Gore scratch Pad variables so that the fields that are not accessible in the client s side from the same form uh that can be stored in a scratch bar variable and then later called upon in the client script as per your requirement so this is a typical example of uh using it now I just had put it in JavaScript executor right let me put it in client script for testing I just showed it in JavaScript executor but in real requirements you will put it in C script only fetch server data from incident form onload save it so after saving this I will refresh the form reload form so it says that inquiry is the category applied right so x x is Gore scratch pad. category C that is nothing but the scratchpad variable that I defined here which stores the value of the current forms category any doubts so this is the use case typical simple use case for the display br any doubts guys all right so um I will disable this because I don't want to see a you know alert every time I load the form now let's get into ACLS so any question so far with query business tool display nothing right so will go into let us uh look at the ACL s ACL the word ACL represents Access Control list right so list of configurations that you have defined to control the access of people across tables across Fields like for example I can Define access control for this entire record hey you should not see this record as all like that I can Define or else I can put only this field should not be seen other fields and all can be seen like that I can put it uh so now um let us try to identify the ACs that we already have in an incident table okay configure security rules and you have all the ACLS I'm taking one sample ACL we have when I open this it is read only right so the read only reason is be uh I need a security admin role so I will get the security admin role only if I elevate my profile to security admin check and then okay after that if I refesh any of the ACs at that time I will edit them okay so uh uh this one is a record ACL and right means like editing of a table for example you have uh you can read the data of the handled by description you're editing description and all right is handled by rightl and some like uh the level of access or restrictions for people to delete a record probably incident record Also let's so like that you have ACS for every single typically so you have something called incident do none incident do star incident dot let's say short description right so these are the different types of ACLS what this means is incident. none means that like the entire record the entire record but instant. Stars means the entire fields of the record incident or short description is a specific field of the record right so you could see that incident. none and you can choose incident. star otherwise you can choose a field or any [Music] field [Music] particular this of the star represents this AIC field right so I will just put up a read ACL and I will say insurent do n which means a table level ACL okay Advanced enable admin override true what does admin override is whatever logic or restriction I'm giving does not applies to admin right I might have written a logic that uh uh you know if loged person is assigned only then you'll be able to see I might have written any restriction but fine but for admin this will not apply admin can see everything so if you have such a requirement you will always enable admin override through but if you want the Restriction to be applied even for admin I mean it doesn't matter you're an admin or not if you don't satisfy this condition you cannot see this record if if you have such a requirement you have to uncheck this since you're testing we'll just check this one we'll have this check there and then um we will put it like if um current dot opened by is not equal to gs. get user answer is equal to false right so um let me save this the moment I save it what will happen is this required roles will automatically be populated with a role called um with a role called snc uncore internal if I had given any existing roles fine but if I don't give any roles system will try to populate and rooll otherwise what you need need to make sure is the condition follows like this whatever roles you have defined here that should be matched and then the condition should be matched and then the script should be matched so this plus this plus this here we have not given anything fine here also we have not given anything fine so finally system will look for the script only now if anybody apart from admin because this logic will not apply to admin fine right if anybody not an admin tries to access a record wherein they are not opened by like it was opened by somebody else then they will not be able to see the record it will return false right so as I told you uh read table right read ACL let me check how many such AC for incident table so I'm going typing ACL so I'm going to this module and uh in filter condition I'll put incident show matching reader so I will only for we have 1 2 3 4 5 six there's only six ACS we have right so what does ACL means like it is a key to your room um like uh let us say you have a it's like a main door okay instant. n is like your main entrance Door uh let us assume that you have five keys to one lock there's one Locker one lock put on your gate main gate it has five keys so you might having a special key and your father might have a different key your mother might have a different key but surprisingly all these key um if let us say feel slow your voice is getting cut from last 20 minutes like up right so table there is one AC like this and this machine learning admin or machine learning report user then you will have access to read the records you need this key or else if you satisfy this condition this condition represents that [Music] approve then you can see the incident so this condition should satisfy if you don't have access to this at least this don't even have this report user we have written um this will come back to the last last and we saying that some hi your screen is completely blank from last past 20 minutes we are unable to hear your voice completely can't hear anything lakmi I'm not able to hear anything please explain a one again because so you need to satisfy this condition at least in order to see it's not like accessing key it it's like denying access kind of yeah tell me can you again explain yes please please explain because we were not able to listen to you properly the screen is blank yeah I got it I just now see the message fine are you able to see my screen now yes fine so what there's only one lock one lock is like access to the main door but you have 10 FY Keys like uh on one key it is written as uh you know made and another key is written as watch and as you know house owner or Mom K is WR as dad the other key it is written as Sun uh you need not be a man you need not be a maid or you need not be a Watchman anything is fine you at least have one of these five Keys you will have access to the record so as I showed you in this place to in order to access access assassin read read the incident data there are six Keys available in the system right now actually originally only five were there and one we created there were five Keys available you satisfy the condition of the like you should be either a mom or man or a maid in order to access the main like uh like that so this says that you need to either have one of these two roles report user or ml admin then you will be able to access the then this means or current. caller ID is logged in person or current watch list contains index of means contains right watch list is a multi value field it can contain any number of users in that one of that users your name should be there if you sfy this then somebody has a role called SN uh incident they should have access so access to at least right then only you can see the incident now in order to test we need to find a user who does not satisfy into any of these condition it is difficult to find a user right disable for testing I will disable all other ACLS except for my in actual requirement you can have 10l 20l but for just for testing I'm showing you with one ASL so that understand like we can switch back and show you what is happening so this is the active ACL that I have rest all is disabled right let me see what is this active ACL so this tells me that incident record and uh current by open by as this thing so I'll put else answer is equal to true all right so it tells me that um if opened by person is not same as logged in person then uh they will not have access otherwise they will have access right now let me try to add inent I put inent do list now I can see 68 records it's surprising right because I uh disabled all the ACs except for one in that one it tells me that I should be the opened by then only then I can see but if you see opened by I can see the records that were opened by itl Bud Richman uh don good why reason is because there is a field called admin override true this is what is giving me access now let me disable what the does is uh if I if I'm admin I don't have to satisfy any of this condition right it's like a landlord like I youan know I can to any any Gates I do not even require a key it is like that I have disabled that option now after disable let me read please yes yes please okay previously if you see can you hear me yes yes previously I was able to see 68 records but now I only able to see 23 records why even though I'm an admin I'm not able to see reason is because uh for incident. table there's only one ACL because all other for test we disabled it and on top of it we enabled this admin override through which means that like admin does not get a special [Music] like what script is the script even evaluate it will give me the complete access so only for people other than admins the script will validation will happen okay now I will refresh this form and I will take any record that has been opened by see I'm taking this one this one is opened by it user right this one is opened by it user um caller is Carol it has no connection with system administrator I have open this record yeah the for the first record okay I'm able to see it I don't have issue reason is because I have enabled this admin override R now let me disable it after disabling if I refresh the screen I will no longer see 68 records again back to the 20 plus records only I will be able to see as per my logic did it got saved or not can you explain this concept tomorrow okay uh because of Internet issue or you stuck up somewhere yeah because of Internet issue from your side not even me but everyone are unable yes yes you can see the messages sure I got it yeah all right sure okay so today we have covered up uh query business rule and display bar tomorrow we'll see in detail the ACL okay which is have five more minutes so that's fine obviously um we'll cover up the entire thing tomorrow but just try to look at the recordings if there is something with regard to ACL that you can check otherwise I'll start acl's fresh tomorrow all right guys so I will stop this sharing