populate choice field based on another field?

Sid_Takali
Kilo Patron
Kilo Patron

Hi all,

I have a requirement where I have to populate a choice field based on another field choice value. How can I achieve this?

6 REPLIES 6

Ankita19
Tera Guru
Tera Guru

Do you mean to create a dependent choice list?

Suppose I have a choice field "ABC" and values are D, E, F, G when I Select a D value then the "XYZ" field should populate below which is a choice field.

Pavankumar_1
Mega Patron

Hi,

if you are looking for dependent fields below link will helps you.

http://www.john-james-andersen.com/blog/service-now/creating-dependent-choice-lists-in-servicenow.html

You can refer the incident  table category and subcategory fields. refer below screen shots.

find_real_file.png

find_real_file.png

find_real_file.png

 

If it is a reference or other field you set the value using business rule. add condition in business rule whenever that condition matches it will set value. 

Below link helps you to set value.

https://community.servicenow.com/community?id=community_question&sys_id=979dafb2dbd22c90679499ead3961971

https://community.servicenow.com/community?id=community_question&sys_id=776c9ccadbc623404abd5583ca961922

 

If it not resolved please share screen shots of fields with field types then I will help you.

 

Thanks,

Pavankumar

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

Ron28
Mega Sage

Yes you can, by using the reference qualifier and variable attributes field. I used this to have a list of values where I didn't want the selected value from the first list (choice values) to show up in the second list (choice values):

The first list assigns a value to variable 'u_source_stack'

Then in the 2nd list add the following, where 'u_stack' was a value obtained from cmdb table that lists the possible values, but I need to remove the value in u_source_stack:
 
Reference qualifier: javascript:'u_stack!='+current.variables.u_source_stack
Variable attributes: ref_qual_elements=u_source_stack

Note the '!=' in my example as I wanted the selected value from the first list to be filtered from the second list. Your case is a little different in that you do want it to show other values in which case you remove the '!' in the reference qualifier.

Ron