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

Brian Lancaster
Tera Sage

You would use an onChange client script and possibly a script include if you are using Service Portal or going to be in the future.

Thanks but do you have code to get started?

I need some more info.  Are you variables pulling from a table?

Upender Kumar
Mega Sage

Hi,

Hope below will help you

 

https://community.servicenow.com/community?id=community_question&sys_id=af1a0fdcdbf8d304b61ff3231f9619bd

 

 

Please Hit Correct, ️Helpful depending on the impact of the response