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.

Filter reference field based on another reference field in catalog item

Community Alums
Not applicable

Hi,

I am modifying existing catalog item "Create item" to include some of the custom fields we added in Case.

I have 2 custom fields Case Category and Case Subcategory as below in the variables.  

Category is filtered down based on the javascript below and works correctly

javascript:'u_is_parent_category=true^u_departmentISEMPTY^ORu_departmentLIKE' +current.contact.department

SubCategory is not filtering the list based on the category selection. It shows everything.  Can you please tell me what I am doing wrong? Thank you

 

find_real_file.png

Here is what I have for Case Category

find_real_file.png

This is for Case Subcategory

find_real_file.png

 

1 ACCEPTED SOLUTION

rahulpandey
Kilo Sage

Hi Angel,

1)- Category filter seems wrong. it should be like below

javascript:'u_is_parent_category=true^u_departmentISEMPTY^ORu_departmentLIKE' +current.variables.contact.department

2)- What is the relationship between category and subcategory ? is category  is parent of subcategory  ? What is field that represents the category and subcategory relationship ?

In subcategory reference qualifier, you have not mentioned anywhere to consider category. 

 

View solution in original post

3 REPLIES 3

rahulpandey
Kilo Sage

Hi Angel,

1)- Category filter seems wrong. it should be like below

javascript:'u_is_parent_category=true^u_departmentISEMPTY^ORu_departmentLIKE' +current.variables.contact.department

2)- What is the relationship between category and subcategory ? is category  is parent of subcategory  ? What is field that represents the category and subcategory relationship ?

In subcategory reference qualifier, you have not mentioned anywhere to consider category. 

 

Community Alums
Not applicable

Category is the parent of subcategory. 

I modified the javascript for subcategory as below and that appears to work

javascript:'u_is_parent_category=false^u_departmentISEMPTY^ORu_departmentLIKE' +current.contact.department+'^u_parent_category='+current.variables.u_case_category

Perfect, I am glad, I could help.