Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Choice variable are options visible based other variable options

Manohararuna
Tera Contributor

Hi Everyone,

I have one requirement on Catalog item form.Having two varaibles Client and Role

Client and Roles both varaibles are  List collector type 

If i select 'A' in Role then  Client variable list showing X , Y, Z

If i Select 'B'  in Role then in Client variable list showing  Y,Z

If i select  'C' in Role then  Client variable list showing X , Y, Z

If i select  'D' in Role then  Client variable list showing X , Y, Z

If i select 'E' in Role then  Client variable list showing  Z   .

 

same having another variable Lcape list collector type requirement in same catalog item

if i select option 'P 'in Lcape and select option in 'F'  and 'G' in Role variable then Client variable list showing     U ,V

if i Select 'H' option in Lcape then Client variable list showing  X, Y

 

for this total requirement provide solution.

2 ACCEPTED SOLUTIONS

Ankur Bawiskar
Tera Patron
Tera Patron

@Manohararuna 

list collector with choices or referring to some table?

it's an easy requirement

what did you start with and where are you stuck?

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

@Manohararuna 

unless you start you won't learn.

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

5 REPLIES 5

Ankur Bawiskar
Tera Patron
Tera Patron

@Manohararuna 

list collector with choices or referring to some table?

it's an easy requirement

what did you start with and where are you stuck?

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Manohararuna
Tera Contributor

if you know the solution ,please send me that one

@Manohararuna 

unless you start you won't learn.

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi Ankur,

Actually i used below onChange script but Javascript error is coming while entering details on catalog item

function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') return;

var filter = '';

switch (newValue) {
case 'A':
case 'C':
case 'D':
filter = 'nameINX,Y,Z';
break;
case 'B':
filter = 'nameINY,Z';
break;
case 'E':
filter = 'nameINZ';
break;
}

// Apply filter dynamically
g_form.setVariableFilter('Client', filter);

 

script is not working as expected.Please help me to fix this script issue