Hiding choice is list collector based on selection of another field

Abbie4
Tera Contributor

Hello,

 

I have an order guide setup for new hires. Within this guide, the manager must first select the brand the new hire will work for from a reference variable to the company table. I then have a list collector variable with a question_choice reference for hardware the new hires can order (originally variable was a multiple choice that has been turned into a list collector). 

 

I want to hide certain choices depending on the brand they select. For example CompanyA should be able to see everything on the list but CompanyB shouldn't be able to see Macbook and CompanyC shouldn't be able to see Macbook or iPhone. 

 

I have read previous articles of adding it to the reference qualifier but 1) I'm not very good with scripting and 2) I don't know how to add anything in there whilst also incorporating the question=sysID which is already in there. 

 

Please help.

 

Thanks

Abbie

 

1 ACCEPTED SOLUTION

Yeah, sure, sorry I misunderstood.  In this format you'll want to keep the logic as simple as possible, so to only show 'password' when 'Acer' is selected would look more like this:

var ret = 'question=8aeaab25c0a8001500044f3982c9ecb5'; if(current.variables.v_company.name!="Acer"){ret = ret + '^value!=password';}ret

then you would have to add an if block for every criteria.  If it gets too complicated we should try the Script Include approach where you can lay out all of the logic and have it return only the correct values within a full script instead of trying to string it all together like this. 

View solution in original post

5 REPLIES 5

You're welcome, good to hear!

 

 

Connect with me https://www.linkedin.com/in/brad-bowman-321b1567/