Hiding a choice when using list collector referencing a different variable.

Abbie2
Tera Contributor

Hello,

 

I have a catalog item 'Smartcard' with a list collector that has four choices on it. It was originally set up as a multiple choice, and then changed to a list collector and the sys_ID references the multiple choice. This is working fine.

 

The problem I have is I have an order guide set up for 'PAS new hire' with a variable 'Service Name' that references the same sys_id, but I need it to only display 3 of the choices, not all 4 (I still need the 4 options on the 'Smartcard' item). 

 

I need it to reference this sys_id as I have other variables that are dependant on the choice that is selected from the list (set up using catalog UI policies). I have tried setting it up as it's own list with just the 3 options (not using the sys_id reference to the catalog item), but then in the backend, it does not show the dependant variable answers. 

 

So my question is, is there a way I can hide one of the choices on the order guide, without it affecting the original Smartcard catalog item?  Or is there another way I can get this working without having to basically remake all the variables? 

 

Thanks

Abbie

1 ACCEPTED SOLUTION

Brad Bowman
Kilo Patron
Kilo Patron

Hi Abbie,

have you tried a Reference qualifier like this on the PAS new hire variable?

BradBowman_0-1676897165191.png

 

View solution in original post

4 REPLIES 4

Brad Bowman
Kilo Patron
Kilo Patron

Hi Abbie,

have you tried a Reference qualifier like this on the PAS new hire variable?

BradBowman_0-1676897165191.png

 

Thank you so much! worked perfectly. 

Is there a way you can hide the choice based on the answer to another variable?

 

For example, if I had another variable with a multiple choice of 1 and 2 on the form, could I have a script that could say 'If 1 was selected, show all 4 options including CYP, if 2 was selected hide CYP from the list'? 

I am assuming it would have to be a onChange script? but as you can tell I little knowledge of script writing 😞

You're doing great, just by trying and asking the right questions. 😉  For the other variable scenario, it would be best to change your reference qualifier to a Script Include call that passes in the value of the other variable - something like this:

BradBowman_0-1676940017554.png

where ritmUtils is the name of a Client callable Script Include, getCompanies is the name of a function in that SI, and v_location is the variable name of the value that we want to pass to the SI.  In this case the SI would include a GlideRecord on the question_choice table with an addQuery for question = <<sys_id>> then in the while next loop you would use an if statement to see if the value passed in for the other variable was 1 or 2, then add the appropriate records.

 

That sounds confusing even writing it, but the bottom line is yes, you can do that in a couple different ways, so if that's an actual requirement we can figure it out.