Servicenow Portal (Part 11a) - Question and Answer Modal Widget Part1
imanakum everyone I'm back with another video and today we'll be doing some more interesting things so I would like to show today I'll make a custom widget where we will be updating the questions and answers the feedback in the background how to take the feedback from the fronton and update in the background so there is a one table which I have already created as QN is and these are some questions which I've already added and so my widget will be the question will be already available to you and whatever answer the user will give over here it will get updated accordingly so let's get started I'll give the name as a question and so I'll save it now I will open in the editor so before going to the HTML part first what I will do I will write a server script from where I will get all the questions and I will push it in the HTML so that lets take an object as qu es so I need to take the question from that table from this table okay so you underscore Q is the table name I'll paste it here qu es dot query it depends like there is if you want you can create one more field as active or inactive and accordingly okay I'll do that I'll create an another field here active or inactive so that it will be better for you because if you don't want some question then you can just make it inactive false take it as true/false and I will make this as active default value I'll make it as true okay so if you want you can make it false and so I'll just add one query here qu es dot add query you underscore active comma true only that records which are true it will take those records while qu es dot next now I need a I need an object where I will push all the questions which is already present in this table so for that I need to take one data dot array I need to take an array dot questions equals to this okay now inside this I will create another object to push data QE object equals to this and QA object dot qu es I have taken another variable to you yes is there and then this qu yes dot u underscore questions okay you notice a question your desk Oh question is the column name of the question okay I will bring the column name here to make Q guys understand [Music] now if you see you under squashin is the name of the question okay and so I am taking this and then I will just push in this question because we know that the communication between a server and HTML goes with data dot so I push in this the object which I have created inside this okay that's it for service now here what I will do is I will write I will design the HTML part so I will write the class equals to form group make it as the green border because now form the equals to I will define this form in my CSS okay now I will write up I will go take a para so that in each para one question will be there X is the variable and in GDP two works the same as for loop seed or data dot questions which I am pushing from server script data dot questions okay and inside I will write like something like this question : so the double open brackets two open brackets identify the value okay so X dot qu is because in we as we are pushing the hombre the object is containing two UAS as the variable name and in this variable name we are having the question so X dot this let's see if it is coming or not okay now if you see it is coming like something like this why why it is coming blank because if that thought to string is important okay so if I gave dot to string here and if I save see question is coming now okay now my next part will be question is available now in next part will be to bring the answer and there will be one text box where you can just write the answer and according to this question the answer will come here it will update in this table okay so guys you try once and wait for my next video so that I will bring the answer here like I will try I will I will help you with the text area and how to update in the table thank you for today I have made a short video so that you guys can try among yourself first and then wait for my next video thank you
https://www.youtube.com/watch?v=K3wRVpqgkLc