one variable dependent on another variable in catalog item

Tanya Rathor1
Tera Contributor

Hi All,

I have a multiple choice of variable. there is 2 question , I have added in catalog item

I wanted to  some variables dependent on 2nd choice of question in catalog item.

whenever user select 2nd choice of question, only that time those dependent field should be visible.

How can I achieve this .

plz help ,

 

Thankyou,

Tanya

4 REPLIES 4

Community Alums
Not applicable

You can most easily do this by Catalog UI policies. Second choice is client script.

Dhanunjay2
Tera Guru

Hi Tanya,

Please refer below screenshot, similar to your requirement

find_real_file.png

find_real_file.png

 

Please mark as correct/helpful if this works

Thanks

 

John Zhang1
Kilo Patron
Kilo Patron

There are many approaches for your requirement.  Please find best approach meet your need from the following posts:

Catalog item variable dependency on other variable

Need help to make a variable dependent on another in a Catalog Item

How to add dependent field on another field in catalog item variable.

 

If my reply is Helpful/Correct, please mark the answer as correct.

Rama Krishna Ye
Tera Contributor

You can use one of the method,

 

1. you can write a onchange catalog client script 

Example: variable "A" depends on variable "B"

select field name: B

in the script section:

you can use below methods as per your logic 

g_form.addOption(), g_form.removeOption(), g_form.clearOptions()

2. In case if you have more options, you can do as below

create custom table with columns  (variable A field, variable B field,...etc)

select variable type of A is lookup select box

reference: custom table

reference query: javascript:"table=XXXX AND variable A column= value AND variable B column=" + current.variables.variable B;

3. -> create a choice list as below
table = catalog item
element = variable name
text = variable A choice lable
dependent = variable B

-> Create variable "A" as below

type: lookup select box

reference: choice list (sys_choice)

reference query: javascript:"table=catalog item AND element = variable name AND dependent=" + current.variables.variable B;

 

 

Please mark helpful if it answers your question.