populate choice field based on another field?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2022 09:50 PM
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2022 09:54 PM
Do you mean to create a dependent choice list?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2022 10:00 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2022 10:14 PM
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.
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
ServiceNow Community MVP 2024.
Thanks,
Pavankumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2022 10:16 PM
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