On a Catalog item, I want to link or make one variable dependent on another based on the value choosen on the form

Lola B
Kilo Expert

I have a catalog form where the requestor would like to have the value of a variable (chosen by the user) to display only values which correspond to those values. How can I make variables dependent on another variable's value in Service Catalog?

 

find_real_file.png

1 ACCEPTED SOLUTION

Lola B
Kilo Expert

I figured out how to do this with a Reference Qualifier on the dependent variable. For example, we have a requirement to make a child catalog variable "Sub Industry" dependent on the parent variable "Industry" on a catalog form. To accomplish this, I also wanted to have the child variable setup as a reference to a custom table as the values were an extensive list of Sub Industries. After I set up the child variable as a type of reference, I used a javascript in the 'Reference qual' field. The javascript used set the parent column label to equal the parent variable and looked something like this: javascript:'u_industry_parent='+current.variables.var_industry. I was having trouble when the child variable would be selected and figured out that I needed to make the child column on the custom table set with a Display value equal to yes. Prior to this, the value returning was the some other value on the table and it wasn't what I was looking for. I hope this information helps. I referred to a few articles on the community but couldn't find one that tied it all together.

View solution in original post

6 REPLIES 6

Lola B
Kilo Expert

I figured out how to do this with a Reference Qualifier on the dependent variable. For example, we have a requirement to make a child catalog variable "Sub Industry" dependent on the parent variable "Industry" on a catalog form. To accomplish this, I also wanted to have the child variable setup as a reference to a custom table as the values were an extensive list of Sub Industries. After I set up the child variable as a type of reference, I used a javascript in the 'Reference qual' field. The javascript used set the parent column label to equal the parent variable and looked something like this: javascript:'u_industry_parent='+current.variables.var_industry. I was having trouble when the child variable would be selected and figured out that I needed to make the child column on the custom table set with a Display value equal to yes. Prior to this, the value returning was the some other value on the table and it wasn't what I was looking for. I hope this information helps. I referred to a few articles on the community but couldn't find one that tied it all together.

Kailash Bhange
Kilo Sage
Kilo Sage

Hi All,

Please take a look at Article below:

1. dependent on single table
2. dependent on two tables using referene

[SOLVED]: - Dependent variable on Catalog item using Lookup Select Box
https://community.servicenow.com/community?id=community_article&sys_id=1ce7dceedb5914101cd8a345ca961952

If my answer solved your issue, please mark my answer as āœ… Correct & šŸ‘Helpful based on the Impact.

Thank you!
Regards,
Kailash.