Servicenow Portal (Part 10b) - Displaying Widget Using Option Part2
so Aslam o alaikum everyone last day I have showed you how this initialized this select button has worked now what I will do is I hope that you guys have tried in your personal instance and if not then this is the perfect place where you will get the whole thing what I have told you earlier in my previous video so now I'll just I've already given the hint in my previous video how to do that so over here what we will do I'll just call the ng change okay ng change equals to L give C dot change and I'll pass the value data dot value okay so there are value have passed data dot value is this one okay means the value means the ID which is there because value I'm using your so data dot value I will pass so now inclined script I will just see whether the ID on selecting of this option the ID is coming in a proper or not so I'll just write the function C dot change equals to function okay and inside this function I'll take the value and I'll give a lot value okay just to check whether the ID is coming properly or not I'll see so it is taking time okay okay so if I change this value because I have written on change okay if I change search so for search incident search was search I have given the ID and for state it should become a state yeah okay so I think so this is coming properly guys now I don't need this value I'll pass this value to server side okay so see door data dot value equals to Val and then I'll just update the server that's it now I'll go to server-side scripting the main point is here okay what I'll do now if input dot value means if you are changing the options and if there is any input like if the ID is there then what will you do what you have to do is theta dot L gift I'll give their name data table digit data table widget equals - I'll call the widget SP don'tget widget and and I'll give the name actually I don't know it is okay if we don't get widget and the name inside okay if input dot value is there if input dot value okay so what is it I will call let's this one I will call this one okay incident state so this widget is having its being the score widget I forgot the ID actually ok search incident and search incident and and what is the idea of the other one new state is the idea of the other one ok so I'll call new state ok let's save it but you are calling if the input is there you are calling the widget but you are not displaying in the HTML so will that work guys absolutely no it will never work so how do I do that now after this DD ok I need another row ok and in this row this is the method of displaying the HTML B widget widget equals two data dot this one data table budget ok so now if I save and if I show you so if I'm changing the state so this is coming but what do I want inflow incident state only this should be visible but and for search incident search this search incident should be visible so there's another way search incident is the ID always take the ID of the widget okay so if though if the input dot value equals to equals to yes state then only it will be visible else yes okay let's give else okay to the Saint such incident saving this one so see search incident with problem is coming and if it is searched then also this is coming why why can he again anyone tell me why it why it is coming like this even though state because tense part is also working okay so I need to define your as well the value okay so here I need to define here that if it is search then you need to call this one then also it will not work properly can anyone tell me why then also it will not work properly okay let me first okay it is not working obviously it will not work why because one search is is coming okay our state is coming so data dot adaptable widget has already got this widget and it is not able to replace with this widget okay so this is the problem now the main part comes over here I have to give ng if condition okay I have to give the deviation and in this division entering to give the in gf okay so what is the ng so let's take first I will okay over here I need to add a division first I need to add the data dot ABC here okay so data dot ABC I will give her value as a state and the same value not same means over here I gave at give as search ok now I'll give the condition here first I will give to the division and in this division I will give the ng if condition ok so whenever whenever the data dot ABC value equals 2 equals 2 state ok ok so I'll just save it okay so many research nothing is working right so ok incident state in this incident state when I'm giving so it is coming ok and in this incident search when I'm giving then also it is coming like this so ok so it is not visible right now because I've given the condition when it is state then only it will come okay so the same thing I will copy and I will give it here just the condition will be instead of state I'll give search ok now see what happens so search it is coming state it is coming search it is coming so everything is working now but if you see carefully if I again just do preview okay so in the beginning it is not coming everything is working in on change so there's another assignment to you how in the initial state it will work so do it guys if you can that's it for today thank you thanks for watching you
https://www.youtube.com/watch?v=2nMTrJmyR6E