Catalog item variable dependency on other variable

asasas
Kilo Contributor

I have Created one variable which is select box type.

11.PNG


Once I select an option from select box, then only other variables should be seen.

can someone help?

17 REPLIES 17

Goran WitchDoc
ServiceNow Employee
ServiceNow Employee

It is pretty easy.



For example:



I have a "select box"-variable named "select_box". This select box has titles and depending on which title I choose, the user variable should only show those with the matching title.


Then I have a reference variable for the user table.



The only two things I need to do it and it's both on the user variable..



1. go to "variable attributes". Here you type ref_qual_elements=NAME_OF_VARIABLE. in my case: ref_qual_elements=select_box.


2. Then go to "Reference qual" and type in the match. In my case it would be: javascript:'title='+current.variables.select_box




Now I will select a title from the select box and the user variable will filter on that choice.




Let me know if you need more help.



//Göran


not clear



Can u explain more clearly


hi Goran,

 

I have the similar requirement,

 
I am working on a catalog item where i have created three variables called,
 
1. "Type" as select box of questions "X", "Y", "Z". 

2. Variable called "dates planned" (type: lookup select box)

3. "Other date" variable.

And I had to create a table and import the data from excel into this table, which contains the fields of above "type", "dates" (type is date), "Planned date (ex. 1st quarter January 2018)", so that i can make this table a reference for "dates planned" variable.

On the Catalog item, When the variable "Type" value is selected as "X", then the "dates planned" variable should show only the reference of "Planned date" records of "X" type from the table, so that the user can select any of the planned date of X type. And then one more variable value should auto-populate when this planned date is selected, i.e. the "dates" field value from the above table created. And then Likewise for "Y" & "Z" type too. 

How to complete this task? Please help out with best possible solution.

Hi,

 

For step fixing the filter on field 1 & 2 you should make that by doing like my answer above. Then to fill in field 3, you would probably need a catalog client script fetching the value through an glideAjax call and populating the field. Does that sound reasonable?

 

//Göran

asasas
Kilo Contributor

I have variable "e-transfer inquiry type" which is select type, which contains many choices in it.



Once I select an option from "e-transfer inquiry type", then only other variable should be seen.



other variables are of different types also(single line, reference, yes/no, etc)







111.PNG


Please help