Limit Reference field choices based on live changes

AjvadK
Tera Contributor

I have 2 reference fields category and sub-category, both referencing the sn_grc_choice table. The category values are set as parent for sub-category values. I need to limit the choice list for sub-category field, based on the category value chosen. I tried using reference qualifier advanced qualifier method using the following code:

javascript:"parent=" + current.category

 

It works fine for a new record, but for an existing record, it is only taking into account saved/server-side value. So real-time changes made to the category field are not being considered. 

1 ACCEPTED SOLUTION

@AjvadK 

try to add this in the Dictionary Attributes of the 2nd field

ref_qual_elements=category

AnkurBawiskar_0-1764854304368.png

 

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

5 REPLIES 5

soumyadeep10
Tera Guru

Hi @AjvadK ,

Usually what is done is, in the sys_choice table, the dependent value is chosen to specify which choice value will appear based on what dependent value. See below as an example.

soumyadeep10_0-1764853781085.png