The CreatorCon Call for Content is officially open! Get started here.

Record producer hide option in variable depending on other variable

CE_
Tera Contributor

Hi,

I have a record producer where the options in select box variable "Report" needs to be adjusted based on the value in variable "Category". So if category is A then option 1, 2, 3, 4 should be visible in "Report". But if category is B then only option 1 and 2 should be visible. How to script this? 

 

Thanks!

1 ACCEPTED SOLUTION

onCHange client script

field name : category

 

if(newValue =="Backend name of Description"){

g_form.removeOption("backend name of Report variable",'backend name of the option you want to remove');

g_form.removeOption("backend name of Report variable",'backend name of the option you want to remove');

 

//like this you can keep on adding line into this loop

}

 

Code explaination:

if category is general all the option will be shown if it is description then i am reoving some option

 

Please mark it as correct and helpful if this answer satisfies your query

View solution in original post

5 REPLIES 5

Saurabh Gupta
Kilo Patron

Hi,
You can write onChange client script with method removeOption.

 

 

 


Thanks and Regards,

Saurabh Gupta

Could you help me some more with how to write the script?

Give the backend name of your variables and choices.

 

 


Thanks and Regards,

Saurabh Gupta

Variable Category options:
General
Description

Variable Report options:
Deviation
Improvement
Standard
Other

So if Category is general then only Deviation and Improvement should be visible in report. If category is Description then all should be visible,