Catalog Item - Dynamically change multiple choice options

JohnMMcLaughlin
Tera Contributor

Hello,

I'm looking for some advice on the best way to achieve the following:

On our Portal we have a Mobile Phone Purchasing Catalog Item, there is a section that is currently made up of a multiple choice variable, with each type of phone our users can purchase, lets say the multiple choice options are:

1 - Mobile 1

2 - Mobile 2

3 - Mobile 3

4 - Mobile 4

Now the bit i need advice on, if a member of staff is a director they should be allowed to choose any mobile in the list, however staff that are not directors are only allowed to select either Mobile 3 or Mobile 4.

I'm able to dynamically hide/show other sections of the form with a catalog Ui Policy, but I can't see anyway to get access to the variables to say which ones are visible and which ones aren't.   I have read about using variable sets but haven't managed to find an example of what needs to be done.

Is a variable set the best way to go or is there a better way to achieve this?   Could anyone point me in the direction of an example.

Thanks in advance for your help.

1 REPLY 1

Deepak Ingale1
Mega Sage

Hi John,



g_form.addOption and g_form.removeOption are the methods you can use



https://www.servicenowguru.com/scripting/client-scripts-scripting/removing-disabling-choice-list-opt...