Need to create a dropdown field in ui page

Community Alums
Not applicable

Please Urgent Requiremnet.......!!!!!!!!!!!!!!!!

Hello everyone,

 
 
I'm new to servicenow, I want to create an ui page with a drop down field.
the drop down will have the user data from user table and click save.
when i select any user and click save then it will redirect to my homepage.
 
Please help me with HTML code and scripts.
 
Thanks in advance.
6 REPLIES 6

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Vinod,

refer these links below

How to add a drop down in a UI page, and based on choice selected fields should be changed on UI pag...

Need help with Jelly script in UI Page using dropdown options

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Community Alums
Not applicable

Thanks for the reply @Ankur Bawiskar 

 

Could you please help me with the code that helps me alot, its an urgent requirement.

 

Thanks

 

Hi,

Sample script below I am showing 10 INC numbers in drop down

HTML:

<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">

	<html>
		<style>
			.color-class 
			{
			color:red;
			}
			.color-blue-class 
			{
			color:blue;
			}
		</style>

		<p class="color-class">hello</p>
		<p class="color-red-blue">Blue Color</p>

		<g:evaluate jelly="true" object="true">

			var inc = new GlideRecord('incident');
			inc.setLimit(10);
			inc.query();
			inc;
		</g:evaluate>

		<select name="tables" id="selected1">

			<j:while test="${inc.next()}">
				<option value="${inc.number}">${inc.number}</option>
			</j:while>
		</select>

	</html>
</j:jelly>

Output:

find_real_file.png

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Community Alums
Not applicable

Hi @Ankur Bawiskar 

 

Thanks for the code, 

I After selecting the incident and i press ok button then it should redirect to home page, For that could you send me the script for that.

 

Thanks.