Drop Down menu that display the option a short description of it

AngelP83
Giga Guru

Hello,

I am very new to SNOW, and I am learning a lot of things very fast.  I am on a project to add a short description in a dropdown menu.  I am able to create the dropdown menu, but I need something like the following (a brief description of what it is).  At this point, I am adding the option from a List Collector, but is it a better way?

Thank you all

 

If I click for example a dropdown Menu that says: Countries

IT will display:

  • PERU - Located in south America
  • ENGLAND - Located in Europe

And when I select one, it will just display the name of the country

Or like this:

dropdown.jpg

 

 

1 ACCEPTED SOLUTION

reshmapatil
Tera Guru

Hi @AngelP83 ,

 

1. Create 'Country' variable of reference type (if want to use core countries)

reshmapatil_0-1671270268315.png

2. Create 'Cities' variable of reference type (if want to use cmn_location) or selectbox type.

reshmapatil_1-1671270398908.png

3. Create a 'Description' variable

reshmapatil_2-1671270448677.png

4. Script Include:

reshmapatil_3-1671270529441.png

5. Catalog Client Script to populate Description

reshmapatil_4-1671270586221.png

6. Final Result on Request form:

reshmapatil_5-1671270623052.png

7. If you don't want to have separate 'Description' variable you can show location.name in 'Cities' variable itself.

Add name in ref_ac_columns

reshmapatil_6-1671270763825.png

 

 

Regards,

Reshma

**Please mark my answer correct or helpful based on the impact**

View solution in original post

3 REPLIES 3

jaheerhattiwale
Mega Sage
Mega Sage

@AngelP83 If you want to select more than one options then go with "List collector". If you want only one option should be selected then go with reference field.

 

And for showing the short description in the drop down option you need to add the variable attributes. Please check below link and check ref_ac_columns

 

jaheerhattiwale_0-1671253433103.png

 

 

https://docs.servicenow.com/bundle/sandiego-servicenow-platform/page/product/service-catalog-managem...

 

Please mark as correct answer if this solves your issue.

Please mark the answer as correct or helpful based on impact
ServiceNow Community Rising Star, Class of 2023

Pavankumar_1
Mega Patron

Hi @AngelP83 ,

You can use the Annotation tab on a variable and use Show Help and Help tag and Hep text or Instructions  to display information or description of field.

Screenshot (522).png

 

If you want to add the short description for the field you can client script show field message which is below of a field.

function onLoad() {
    //Type appropriate comment here, and begin script below
    g_form.showFieldMsg('bu', 'Please add BU Name');
}

 Result:

Screenshot (521).png

If it helps please click Accept as Solution/hit the Thumb Icon.
ServiceNow Community MVP 2024.
Thanks,
Pavankumar

reshmapatil
Tera Guru

Hi @AngelP83 ,

 

1. Create 'Country' variable of reference type (if want to use core countries)

reshmapatil_0-1671270268315.png

2. Create 'Cities' variable of reference type (if want to use cmn_location) or selectbox type.

reshmapatil_1-1671270398908.png

3. Create a 'Description' variable

reshmapatil_2-1671270448677.png

4. Script Include:

reshmapatil_3-1671270529441.png

5. Catalog Client Script to populate Description

reshmapatil_4-1671270586221.png

6. Final Result on Request form:

reshmapatil_5-1671270623052.png

7. If you don't want to have separate 'Description' variable you can show location.name in 'Cities' variable itself.

Add name in ref_ac_columns

reshmapatil_6-1671270763825.png

 

 

Regards,

Reshma

**Please mark my answer correct or helpful based on the impact**