How to hide the list collector variable values based on a specific value when selected.

phr
Tera Contributor

Hi All,

 

I have a variable type List Collector where, on selecting a specific value the other values has to be hidden.

Example : 

On selecting the below value "GitHub Co-Pilot (cost : 19 €/month) " the other values should be hidden except "GitHub Enterprise (cost : 14 €/month)"  value.

phr_0-1718026191892.png

 

I did make use of removeOption() method but it isn;t working as the variable is List Collector.

I also made use of UI Policy but it is also not working.

 

How to achieve this?

 

1 ACCEPTED SOLUTION

Sandeep Rajput
Tera Patron
Tera Patron

@phr Since this is a list collector variable, removeOption will not work in this case. It only works with choice fields.

 

To hide the other choice values you would need to use a reference qualifier and a hidden variable. Value in the hidden variable would only get populated if the choice is either GitHub Co-Pilot (cost : 19 €/month)  or GitHub Enterprise (cost : 14 €/month). On the onChange script on service_required field, you will set the hidden variable and this hidden variable will be used in the reference qualfier of the list collector to filter the choices. 

View solution in original post

1 REPLY 1

Sandeep Rajput
Tera Patron
Tera Patron

@phr Since this is a list collector variable, removeOption will not work in this case. It only works with choice fields.

 

To hide the other choice values you would need to use a reference qualifier and a hidden variable. Value in the hidden variable would only get populated if the choice is either GitHub Co-Pilot (cost : 19 €/month)  or GitHub Enterprise (cost : 14 €/month). On the onChange script on service_required field, you will set the hidden variable and this hidden variable will be used in the reference qualfier of the list collector to filter the choices.