UI Policy and Data Policy in ServiceNow | What is UI Policy | What is Data Policy

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] in order to subscribe to my channel please click here or click here please share comment and like my videos and channel hello guys welcome to sas worth service now in this session we will learn about ui policy and data policy lot of people always have a question what is the difference between ui policy and data policy this question is also normally asked during interviews so in this session we will learn about ui policy and data policy and how both of them behave practically in my personal developer instance ui policy ui policy is used to make fields mandatory visible and read only on the form which means if user opens the form and performs some action on the form then you want to make some fields mandatory and or hide them or make them visible in that case and you also want to make them read only in that case you could use ui policy data policy data policy is used to make fields mandatory and read only in the backend at server level that means in ui policy we were talking about it runs on the form and data policy basically runs at server level in the back end which means if user or system is creating record and you don't want to create that record until a field is field that is a mandatory field and maybe users should also not send the data in a field which is like read only even if even if user is sending or you're sending that data with an api or any transform map system should not accept it because that field is basically read-only and if you don't want to accept it then you can use data policy difference between ui policy and data policy ui policy is used to make my field mandatory visible read-only and hide and show related list data policy is used to make field mandatory and read only only that means you can only do two things with data policy that is mandatory and read-only and in ui policy we can make it mandatory visible read-only and i think if i talk about the recent features now you can also hide or show related lists as well ui policy runs on form that means it runs on client side that is the difference that is what ui policy is and if i talk about data policy data policy runs on server side so what when you write or create a ui policy it runs at client hint and if you create any data policy it runs at server sides it's a server side uh policy you can write a script in ui policy for ui policy you have an option in an advanced option you can write the script as well but in data policy there's no way to write script ui policy is applied only on the main form of the table that means whenever you write a ui policy it will just run on the client on the same form you have for a particular table but data policy can be applied to the data entered into the system via different ways like import sets web services mobile ui that means once you create data policy and whenever you are creating records maybe from web services maybe from import sets maybe from mobile ui in that case data policy will be applied ui policy module now let me show you the ui policy module in my personal developer instance so this is my personal developer instance for ui policy module you just type here ui policy here and under system ui you will see this ui policies so maybe i will just type right here and you can see i think we have a lot of ui policies which are related to some other other elements but here the main ui policy which will open the list of all the ui policies you have created in the system and as of now this is out of the box i have not created single uh ui policy in this particular instance data policy module so let's see data policy module in my instance so if i go here and i type here data policies so under system policies so there's a difference now ui policy is in system ui and data policies they are in system policy so under rules you have data policies if i click here you will see the list of data policies created as of now these are all out of the box data policies again i have not created a single data policy as of now in this particular instance ui policy form so let's see how exactly the ui policy form look likes and what are the different fields what are the options you have when you will create ui policy so if i go here and if i just type ui paul here and i go to ui policies list here we have the list and if i click on this new button this will open the ui policy form so this is the ui policy form now here you can select the table on which you have to apply this ui policy then you can provide the short description you have order because ui policy definitely runs as per the order because you might have different conditions you might have different actions you have put in as part of making fields mandatory visible and and read-only in that case you have to put the order and it will run in the order that's that's what the ui policy works then you have application this is just a global or which scope you have so you can just select the application it will automatically select as per the application you will select over here uh then you will make it active or inactive and then you have a section where it says when to apply so you can mention that when exactly you want to apply this ui policy and then you have this advanced option that is script options so whether you want to run a script or not and if i will check this box you can see it says execute if true that means whatever condition you will mention over here so in this section it says when to apply that means you want to put some condition maybe state is priority uh the priority of the uh uh your incident form maybe is one and maybe a short chart description maybe should not be empty then it should take some action then that is what you mentioned over here when to apply if i click on this add filter condition i think i have to select the table first so let's say if i select incident table and you will see i can just select any field of incident table and i can just select the condition when exactly i want to apply it so whenever user will open the form if condition matches then it will take the action accordingly and what action we will see it later uh so here you mentioned the condition then you also mention whether this ui policy basically it is basically applied on all forms views in that case you can select this global uh it says reverse if false that means if if the condition is if condition is false do you want to reverse it that's something you can mention here and then you have on load that means whether you want to run the same ui policy for on load or not that is something you can mention over here and then this is just inherit whether you want to extend this ui policy if you have applied it on a table whether the child table should inherit this ui policy or not it's up to you as per your requirement and if i go to the sections as i mentioned if condition matches if you're not able to achieve any action that means which you are talking about mandatory visible or we are talking about read only if you have some other client requirements that means on client side that is something you can mention here as well as per the condition if you want to make it to the true then you can put it right here if the condition is false you want to do something that's something you can mention over here so that's how that's how you write the script in ui policy so these are the these are the options now another option maybe i'll just quickly uh mention here test and i'm not putting any condition right now and i'm just clicking on save if i click on save you will see another option where we can provide ui policy actions now there are two types of actions which we just talked about making field mandatory read-only or visible or hidden that is something another section you have here ui policy actions now another is related to relate related list and that is right here whether you want to uh basically make a related list visible or hidden as per the condition you want whatever condition you are selecting over here that's something you can select here so if i go here and click on new button you will see it will open up the form you can select which field you want to take that action you want to make mandatory you want to make visible or read only that is something you can select here similarly if i go back and i go to here and i click on new you can see i can select the list name now this will automatically populate you that all the related lists we have for that particular record uh for that particular form basically and then you can select here whether you want to make it visible or you want to hide it as per the condition so this is this is what you have uh the different configurations different options in ui policy form data policy form so let's see what all options we have in data policy form how exactly it looks like so you just go to i will just go to data policies i will click here this will open up the list of all data policies we have in the system and i can just click on new if you if you will click on this new button it will open up the data policy form you can see it's quite different from ui policy and you can select the table here so let's say if i select incident now you have similar kind of options like inherit you have reverse if false active you can provide the short description maybe i will again do test and then you can also provide the condition over here and the best part here you can see which i talked about it about the data policy that if you want to apply it on import set separately that is something it has already mentioned so maybe you want to apply uh that particular data policy not just on on creation of the racket from from the interface but you don't want it from emperor sets in that case you can maybe deselect it and then you also have it for soap and then you also have another option here while creating this data policy do you want to apply it on client level as well that means same ui same data policy so if i click on save here now what action it will take i will show you quickly so as i talked about data policy that vita policy you can all only make fields mandatory or read only visibility will not work with data policy because visibility is something about the client that is from the form so that means you can only make fields mandatory and read only with data policy rules and whatever action i will take you whatever rules i will mention over here if you want to apply same data policy on the ui level as well accept visibility but you just want to provide that option of mandatory and read only then you can check this box else not how to make a field mandatory from this section onwards i am going to show you that how exactly you can perform all these configurations in data policies and ui policies so let's start with making a field mandatory so if i go to my instance and if i go to ui policy so i will click over here and i can sort it with updated so i will just open the same ui policy which we mentioned as test so i will open this one now while i'm opening this i will also open list of incidents so we will try to apply it on incident and if i come here and i will just open the list of incidents we have so that i can show you what exactly i'm doing what kind of output we are getting so let's say i am opening this one so this incident is open now as of now you can see let's say if i change the category to disk it is not making any field mandatory so what we will do as an example if sub category is basically disk then we will do description as mandatory now this is just a demo now if if i talk about your instance if you are getting a requirement from a customer it might be different the situation the fields the scenario will definitely be different so this is just a demo i'm showing you so you can apply the similar kind of logic for your requirement as well so whatever demo i will show you in this session it is just a practical example it is not something that which will be basically maps to your real use case it is just an example which i'm showing you so if i uh go back to my ui policy and i'll just give it a name uh make and this is something that you have to put the name logical so that people understand what exactly this ui policy is so we have make description mandatory mandate three so i will make it and what is the condition so you can say when to apply now applying is i will select subcategory and sub category is disk so whenever subcategory is disk the description should be mandatory how will i make it mandatory i will first save it this is saved and i will go at the bottom and i will create a ui policy action that means when to apply is created but what action it has to take that's something you have to select over here and we will select description field it is right here we have to make it mandatory i'm not touching other other two options so we will make it leave alone leave alone means don't touch this field if even if it's running this ui policies even if i create this racket without touching this it will try to run this ui policy but it won't take any action so i will just make it mandatory and i will make it true and i will just click on submit once it is done once this is created you will see the difference now and if i go here and if i reload my form i will reload once it is reloaded and if i select disk you will see that description became mandatory but if i talk about before we created this ui policy this description option the subscription field was not mandatory how to make a field hidden or visible let's take a look so i'm over here let's say that if i have uh maybe this particular sub category is a keyboard so in that case i can maybe uh hide this service field so whenever i am i have this keyboard i will make this service field hidden so in that case um let me let me just maybe we will try to do the same so i will just change the category sub category is so as i mentioned ui policy basically runs uh with the order so you have to make sure that if you have a particular field and you have uh created multiple ui actions then you might get some issues so you have to see the right order to troubleshoot it so in that case i'm not i'm not basically using the same option so i will make it if it is let me so keyboard and i will save it i'm not changing the short description so maybe i will just keep it demo for now so that we don't get confused so i will continue to use the same ui policy just to show you the examples that what exactly the difference we have between ui policy and data policy and what is data policy and what is ui policy so i will just make a demo for now and i will save it now i will just edit the same ui policy action so if i go little bit bottom here i just open the same racket of ui policy action it is right here so rather than this true i will make it a leave alone and we had to hide that so if i select what was that field uh service and i should have that field let me check yes we do have that field so service field should be maybe true so when service is basically uh keep the condition that's the uh the sub category is keyboard then only this field should be true else not or maybe let's let's hide it if you're selecting keyboard as a category let's hide it and let's not make it visible so if i save it it's done it is saved and if i go to my form i reload it and if i select sub category as disk you can see now description is not becoming mandatory because we have just changed the ua policy action now what i will do now i will just select keyboard if i select it you can see that service field is hidden now so that's how you can hide and make fields visible with the help of some conditions on a form with the help of ui policy how to make a field read-only so how exactly you want to make not editable so in that case i will go to my instance and here let's do one thing if i maybe let's say the sub category is memory and we will make a description as read-only or maybe let's say assignment group is read-only that's this example so i will just go to my ui policy i will search it again ui policies this is the one and i will just make the condition so we have subcategory memory so i will make it read only so i will come here subcategory is memory or maybe we are keep on uh using the same field let's try any other field let's say uh you have this uh category so if category is network then make this description field read-only let's do that so if category is network and i save it it is done and i go to my ui policy action i open this and here i will select the description field that's what the action we have to take we have to make it read only so we have description i will make it leave alone and i will make it true so i will update it it is updated and if i go here and i reload if i'll select here maybe let's say keyboard you can see nothing happens service is still there and if i select hardware as network you will see the magic you can see here description field became read-only i cannot add it i cannot touch this field that means user cannot do that so that's how you are able to understand the practicality that if if you want some users they should not touch this field with some condition that you can achieve with the help of ui policy on any records form how to make a related list visible or hidden as of now we were talking about making fields uh some some mandatory visible or read-only now this time we will see how can you make a related list hidden or visible so if i come here so you can see we have this five and we have this approver as well so what we will do if the state is new then maybe let's let's say hide this uh this particular list so for that i will just come over here and i will select here state we are just changing the same ui policy i will select state and i will select new so if state is new i will save it and then i will come little bit bottom so here we have ui policy related list related list actions and i will click on new and i will select the related list name so we had approvers it is automatically populating over here and i will make it false do not show it do not show the related list if the state is new and if i click on submit this will create that related list action and let's say maybe this one i will delete it i will just delete it for now so this is done and if i come to my form and i reload it if i reload it you will see the state is still new what do you think and if i go at the bottom you can see here that we don't have approvers related list anymore so that means you can do that that without doing any kind of scripting and you can hide things or fields and related lists and make them mandatory make them visible with the help of ui policy let's see how data policy works so we will see how to make a field mandatory so if i go here and this time i will not go to the new list because this time we will create new records so i will go to data policies and i just go to here and i click on this new button to create a new data policy i will select the table and that will again be incident i will select it and what i will do i will demo i'll keep the name as demo the condition i will select maybe let's let's not put the condition maybe without condition we should we should we will make description as mandatory let's do that or or let's let's see incident if i go here and if i just open a new form i want to see that whether maybe we have this assignment group let's see if i can create a ticket without putting assignment group so if i click on save so yes you can see it has created the ticket even assignment group because it is not mandatory as of now there's no data policy now you will see the difference so if you remember on the form you can definitely make it mandatory but if something you want which at the server level that means if somebody's inserting the record maybe from api maybe via directly from the form as well but it would not run on the form it will run when basically record is being inserted so in that case i will come over here and i will just create this i'm not putting any condition right now what i will do i will go to directly data policy rules at the bottom i will select here assignment group that's what we will make it mandatory and if i will select here mandatory and i click on submit you're done your data policy is created but there's no condition as as of now that means your data policy should run in in the first go when you will create the racket and if i come over here as of now i'm still a client so i don't have anything on the client but yes there is one because you can see here now we do have assignment group mandatory and why is that and that's the important part which we talked earlier as well if i go here you can see this check box as ui policy on the client that means when you will create a data policy you want to use the same actions same same rules on ui level as well then you can check this box but i want to show you just data policy right now so i will just uncheck this and save it and then i will reload the form as well so i will go here i will reload it and you will see this time you will not see assignment group mandatory you can see here it's not mandatory so if i try to create an incident and i just type here and i click on save let's see what happens absolutely you can see that it says data policy exception following fields are mandatory so you have to that assignment group is mandatory until an unless assignment group will not be filled you cannot create the incident racket and that is the difference guys so you can see that once user will open the form at form level you want to put something mandatory read-only or visible or you want to hide something that is what ui policy is and if you want to just do it at server level once you record is basically before creating the racket you want to put some policy that hey system please check this if this field is mandatory or not then only it should insert the record else not that's what data policy would do how to make a field read-only now with data policy we will also make the field read-only that means again this time you cannot push that value from the system so what i will do i will come to my data policy again no no basically no conditions again i will just open the rule so that i can show you and if i now this time we will make it read-only assignment group will be read-only i i'm just using the same field so that you understand what exactly the difference that how exactly is read only works so i will just make it leave unknown alone for now and i will click on update so this data policy rule for that data policy will be updated i'm not using it on on on client right now so i'm still making this check box unchecked and this time i will click on here and i select here now you will see the difference as of now we were not sending anything and it was returning hey you cannot create the record but this time i will select something let's select something maybe i will select analyst and if i click on save you will see the magic again it says hey this field is read-only you cannot insert the data you cannot put any data in this field and that is what the feature of data policy guys so if i think it's a very solid feature i would say that if you want to put something some kind of very very strict process for creation of the rackets so people should not find any kind of loophole just use your data policies they are creating the records maybe via api import sets or by any way they will not be able to insert the records until they are meeting all the expectations all the policies which you want to apply while creating the rackets in your system convert a ui policy to data policy now there's another solid feature with data policies and ui policies you can convert them between each other that means you can convert a ui policy into data policy and you can also convert a data policy into ui policy how can we do that let's take a look so before we talk about data policy we will convert ui policy into a data policy so if i come here and i just maybe just close that one and i just go to ui policy so here we have the same one and i will just click here now before you convert ui policy in into data policy now there are some prerequisite now what are those prerequisite basically your global option should be checked that is the first option you have to make sure now another other prerequisite is that there should not be any action where you have mentioned visibility because data policy does not have any kind of visibility you can't make things visible because it's not it does not run on client so that's the reason then you can convert a ui policy into a data policy uh that's that's basically uh another condition now another as another basic third condition if i talk about is this run script this should be disabled it shouldn't be enabled and now if i click on save and you should also not have related list because i think that's not the one your your data policy can do so i think you can remove it maybe and but you still saw the difference right here that now you are getting this option so majorly those through three options are very important the prerequisite which we talked about once you will once your system will basically match that yes you are you you have you don't it is not basically uh making those conditions true then it will show you uh this button related link and if i will click this button this will disable this ui policy and then just create a data policy so in the meantime what i will do i will just delete this related list action so i will delete it it's deleted yep it's done and now i will click on that related link so if i so we will click on this button and if i click on that you will see a message new data policy created from ui policy now again this this data policy will definitely be applied on client as well why the reason behind it you still have this check box checked use as ui policy so you can uncheck this if you don't want to apply this kind of policy or actions you have i think this will also be copied but as of now we didn't have any that's the reason it didn't copy but you can see condition has been copied and you can also uncheck this if like it should be asked for your requirement that's how you convert a ui policy into a data policy convert data policy into ui policy so let's see how you can convert a data policy into a ui policy so if i go here now before you convert the data policy into ui policy you again have prerequisite and what are those prerequisite is i think it's just one prequisite a prerequisite i would say that is that your data policy uh i think should should if you are just if you just want to use that ui policy just for mandatory and read only because that's what it will convert because data policy does not have visibility so if you want to convert it you have this option right here and if i click on this button it will again convert to ui policy so you can play this game conversion to and throw but yeah that's how you convert a data policy into ui policy so that's what is the diff that's what the difference i would say now before i enter and this session i know i think uh maybe i just thought that i can quickly show you the scripting part as well so i can just show you maybe this state is new and this is on load and i can do one thing and i will show you quickly if condition is true and i just do alert i'm just showing you that you can also write the script here and i can just do alert now you won't do it for alert i think that's something you have to uh perform the scripting as per your requirement but this is i will just mention this is ui policy uh demo and if i click on save and i go to incident i click on create new let's see yeah you can see that it is showing you uh the alert the this is ui policy demo the reason behind it because that's what the ui policy is ui policy runs on client so and that's the reason we wrote that alert and that's the reason it is showing that browser alert and with the help of same ui policy and it is showing you showing you that particular alert what what we wrote in the script so that's what you can you can perform the practical example that's how you can use uh ui policy and data policy uh if you get different requirement from your customers and clients and that's how you can decide as well and i'm sure now you can decide whether you have to create ui policy whether you have to create data policy or you have to create both of them and it is definitely as per your business requirement i hope you like this session and now you will be able to help and create different requirements provide the solution to your customers and clients so please like my videos subscribe to my channel comment on my videos and do not forget to share my videos and channel to your friends and colleagues thank you and have a great day
Info
Channel: SAASWITHSERVICENOW
Views: 5,040
Rating: 4.9649124 out of 5
Keywords: incident management, incident, What Is ServiceNow, what is servicenow platform, servicenow training, servicenow administrator training, servicenow tutorial, servicenow tutorial for beginners, what is servicenow software, what is servicenow administrator, servicenow basics, ServiceNow versions, ServiceNow Platform, introduction to servicenow, servicenow, what is ui policy in ServiceNow, ui policy, saaswithservicenow, data policy, ui policy and data policy difference
Id: oBMvydB1oGo
Channel Id: undefined
Length: 38min 28sec (2308 seconds)
Published: Mon Aug 24 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.