
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2018 08:00 AM
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?
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2018 08:24 AM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2018 08:06 AM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2018 08:08 AM
Thanks but do you have code to get started?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2018 08:14 AM
I need some more info. Are you variables pulling from a table?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2018 08:17 AM
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