One field is dependent on two fields

alvatindra
Giga Contributor

Hi,

I have category and subcategory choice fields on change form.

subcategory field values depends on both type and category choice fields.

Ex:

If category is x and type is normal then subcategory should be p,q

if category is x and type is emergency then subcategory should be y,z

how to achieve two way dependency on subcategory field?

11 REPLIES 11

Chuck Tomasi
Tera Patron

Hi Alvatindra,



Choice list dependency only works against one dependent field. One option to meet your requirement is to use reference fields instead of choice fields and use an advanced reference qualifier to do the filtering. This does involve a bit of scripting.



Reference Qualifiers - ServiceNow Wiki


Gaurav Bajaj
Kilo Sage

Hi,



There is no way you can achieve it by adding it as dependent field, since it allows only one field dependency,


You can try using on change client script and check values for both type and category every time subcat is changed and call glideajax for a lookup table,


where you can store the relative values for them.



Let me know if that helps.



Thanks


Gaurav


Deepak Kumar5
Kilo Sage

Good call Deep K! This is the same method used by incidents to define priority = impact + urgency. As long as the getters & setters are on the same table, this is the best solution.