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.

Dependent Values lookup

George56
Tera Contributor

Hello,  Was wondering if some one could help me with retrieving a list of sub-categories based on their dependent value.  Basically I have a catalog item where you pick a category and I want the sub-category list to only show those associated with the category.

Thanks

1 ACCEPTED SOLUTION

Mahesh23
Mega Sage

Hi,

 

You can try below method

For category 

 

Variable type : lookup select box 

Lockup from table : choice (sys_choice)

Lookup value field : value

lookup label field : label

reference qualifier: element=category 

if table specific 

reference qualifier = name=incident^element=category

 

For subcategory  

 

Variable type : lookup select box 

Lockup from table : choice (sys_choice)

Lookup value field : value

Lookup label field: label

reference qualifier: javascipt:'element=subcategory^dependant_value='+current.variables.'CATALOG ITEM CATEGORY VARIABLE NAME'

 

if table specific 

reference qualifier = javascript:'name=incident^element=subcategory^+current.variables.'CATALOG ITEM CATEGORY VARIABLE NAME'

 

variable attributes: ref_qual_elements=CATALOG ITEM CATEGORY VARIABLE NAME

 

Regards,

Mahesh

 

 

 

 

View solution in original post

11 REPLIES 11

Does this look right?

Category

Reference qual

name=samp_sw_product^element=u_category

 

Sub Catgeory

Reference qual 

javascript:'name=samp_sw_product^element=subcategory^dependent_value='+current.variables.v_category

Variable Attributes

ref_qual_elements=v_category

George56
Tera Contributor

Thanks you all.  I was able to get it to work using the suggestion by Mahesh.  I realized when I first entered the information I was using the Lookup label field Label(uppercase) rather than label(lowercase).  I also found in the Reference Qualifier for Sub Category I was using the wrong element.  Thanks again