#5 Create UI Policy | Learn Application Development in ServiceNow | Leave Management System
[Music] please subscribe to my channel and click on the bell icon to get the regular updates of my channel and do not forget to like comment and share so let's go to our next functionality and that is hide end date for half day in that case i will go to my instance and i will just quickly go to leave request so i can show you the what exactly i'm talking about as part of this requirement and here we have this half day now if i check this box so as of now you can see i can fill the end date and i can also select this box idly it should not happen so whenever uh this half day is true basically it should hide this end date that means but one more thing that it should also be mandatory so if i'm not selecting half day then end date should always be mandatory because that's i would say in order to fill the request so you have to submit the request it's very important that you have to fill start date you have to fill end date as well so what you can do in order to make it working as part of that when i when i make this through that only end date should be visible to phil so i will go to the studio i will go to application file over here i will go to client development because that's what the ui policy is i will select this one and i will just double click it will open up the new racket and i will select the table that is leave request that's what we are where we have to show uh basically uh basically perform this action of the ui policy and here i can just mention hide uh end date end date for half half day that's a name i have given now what condition you can put here do i have to put the condition half day is true do i have to put the condition half day as false so we will basically make it reverse we will not make his make it true we will make it false that means whenever half day is false basically end date should be visible and it should be mandatory as well so if i come over here maybe i will save it first because we have to create now ui policy action and if i come over here at the bottom i will click on new button and i will select the field name now here's the field end date selected now here i will make it true because i have to make this field mandatory if half day is not checked and i have to also make it visible read only no i will make it leave alone and it says clear the value do i have to clear the value so i think now this is something so for example if i'm changing it from half day uh basically uh initially it was like true am i if i'm making it false uh in that case then should i remove the value i think that is something you can do uh maybe if i select this one and uh maybe let's not do right now because this will basically clear the value when it will perform this action so the if if i'm making i'm making the half day field as false it will make mandatory it'll make it visible but it will also clear the value if it had any value so i'm not doing it right now so i will just save it so our ui policy is created that's it you're done ui policy is created now you have to test it so we will do a test whether it is working or not so i will just reload the form leave page yes you can see it is mandatory but if i will check this check box you can see it's gone and i cannot put any end date on this form so user cannot fill anything on this particular form so that's how you can create ui policy in service now and you can make fields read-only you can make fields visible you can make fields mandatory as well as for the different conditions you want to basically run them on the form
https://www.youtube.com/watch?v=D6R2UBOrWmg