Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Restrict Drop Down Choices Based on Assignment Group

kevinthury
Tera Guru

We have a goal of restricting a new drop-down list on the Incident form based on what is selected for the Assignment group. 

In my Personal Instance, I created a field of ‘Assignment Group Detail’ (type=string) with a number of choices.  I modeled the functionality after the Category/Subcategory list in that I added set the ‘Dependent on field’ to Assignment Group and the Choice dependent value to a Group name.

find_real_file.png

This failed to offer any values.  I tried to change the Dependent value to the sys_id of the group, and that failed as well.

The only way I was able to get this to work is by creating an OnChange Client Script that would copy the value of the Assignment Group field to another string field.  I then changed the Dependency to that new field and the drop down was properly constrained by the Assignment group choice.

 

While this is producing the desired results, I am questioning the efficiency.  Is there a way I can get the same results by having the Dependent field be Assignment Group and bypass the need to copy the value?

1 ACCEPTED SOLUTION

Chuck Tomasi
Tera Patron

I haven't mixed dependent field types before and don't know if it supported. I've done choice-to-choice like category and subcategory and I've done reference to reference (assigned to and assignment group). Because a choice field is effectively a string, copying your value to another string field seems to make sense.

You could try making your detail field a reference and move the choices to a new table for the bespoke choices. Then try making your detail field dependent on the assignment group field (ref-to-ref).

View solution in original post

6 REPLIES 6

Marking Chuck's answer as correct as this method allowed us the most flexibility in using across multiple forms apart from incident.

Steps Taken to Resolve:

1.  Created a new Table to house the data

2.  Created a column on the TASK table referencing the newly created table and added dependent field value (in my case...assignment_group)

3.  Added the newly created column to the Incident form and configured.  (New column can also be added to other forms as needed.)

Max C1
Giga Contributor

I did a client script to display different category options based on assignment group and another to load the correct subcategory dependents. This wouldn't work for you?