Combining catalog items that contain a select box

Mike LHCG1
Tera Contributor

We are in the process of streamlining the Service Catalog, and as part of that, we are combining catalog items where possible. In one case, there are 3 catalog items for a particular team for the different responsibilities/tasks that they carry out and each contains the exact same fields. Instead of three catalog items, I want to create one catalog item with 3 radio buttons representing them, and depending on which radio button you select, it will control the short description of the SCTASK and the selections available in the select box field.

 

The SCTASK is easy, but I'm trying to determine how, depending on which radio button is selected, do I display the correct selections in the select box, and then if the requester changes their mind and selects a different radio button how to change the selections so the correct list is being displayed in the select box. I'm pretty sure I can't do it with a catalog UI policy. Would it work if creates a variable set for each of the 3 select boxes and display the correct one based upon the radio button selected? Any suggestions would be appreciated.

1 ACCEPTED SOLUTION

jcmings
Mega Sage

One option is to use a onChange client script and use g_form.addOption and g_form.removeOption. 

 

Another option is to have three separate select boxes and use the UI Policy to control which one appears. So for instance if radio button 1 is selected, display select box 1. If radio button 2, select box 2. You should be able to achieve this with variables instead of variable sets. 

View solution in original post

2 REPLIES 2

JenniferRah
Mega Sage

You will have to create a Catalog Client Script that runs when the radio button is changed. Then it will remove all selections from the Select Box and add the correct ones back in. It's not elegant, but it's the simplest way to change selections within a select box based on conditions.

jcmings
Mega Sage

One option is to use a onChange client script and use g_form.addOption and g_form.removeOption. 

 

Another option is to have three separate select boxes and use the UI Policy to control which one appears. So for instance if radio button 1 is selected, display select box 1. If radio button 2, select box 2. You should be able to achieve this with variables instead of variable sets.