how to create pop up ui page with choice fields in incident form on servicenow

siva14
Tera Contributor

in incident form whenever we select an assignment group, we need ui pop page with 3 different choice fields questions, once we submit popup and after saving the form, i want to see those 3 fields in incident variable section, anyone please help me to solve this.

i have created record producer, so i just need help on ui page code

 

#ui page#incident#pop up

4 REPLIES 4

Neel Patel
Tera Guru

Hi Siva,

 

As far as I know, you cannot use UI pages in traditional service portal.

I suggest to create a modal template and use as modal.

This link should help: Modals in SP

Danish Bhairag2
Tera Sage
Tera Sage

Hi @siva14 ,

 

Can u try this code , please modify as per your requirement.

 

<!DOCTYPE html>
<html>
<head>
<title>Custom UI Page</title>
<style>
body {
padding: 20px;
}

.question {
margin-bottom: 10px;
}
</style>
</head>
<body>
<h2>Response Questions</h2>

<div class="question">
<label for="response1">Question 1:</label>
<select id="response1">
<option value="option1">Option 1</option>
<option value="option2">Option 2</option>
<option value="option3">Option 3</option>
</select>
</div>

<div class="question">
<label for="response2">Question 2:</label>
<select id="response2">
<option value="option1">Option 1</option>
<option value="option2">Option 2</option>
<option value="option3">Option 3</option>
</select>
</div>

<div class="question">
<label for="response3">Question 3:</label>
<select id="response3">
<option value="option1">Option 1</option>
<option value="option2">Option 2</option>
<option value="option3">Option 3</option>
</select>
</div>

<button onclick="submitResponses()">Submit</button>

<script>
function submitResponses() {
// Get selected values
var response1 = document.getElementById('response1').value;
var response2 = document.getElementById('response2').value;
var response3 = document.getElementById('response3').value;

// Pass the selected values to the client script
onSubmit(response1, response2, response3);
}
</script>
</body>
</html>

 

Thanks,

Danish

 

is there anything can we write on client script ?

siva14
Tera Contributor

could you please help me on client script as well