How to show catalog variables based on selection of a catalog item names in a select box

srinureddy1642
Tera Contributor

I have total 17 catalog items. Now I want to merge all those into 1 catalog item(dont need order guide).

I have created 1 select box and i added 17 catalog names. Based on the selection catalog item i want to show related variables of that catalog item dynamically without creating all the variables.

7 REPLIES 7

harshavinay
Tera Contributor

If you are fine with having the variables in the individual catalog item as variable sets, it would make it easier for you. All you have to do is add the variable sets in the master catalog item and display the relevant variable set based on the selection. You should also consider the overhead on the client side if you were to create a UI policy or client script for each item selection. You could try having a single onChange client script to control the visibility of the variable sets.

Also, you should consider the fact that each individual item would have its own client-side logic. Defining them at the variable sets would allow you to retain them when you use them in the master catalog item

 

Ankur Bawiskar
Tera Patron
Tera Patron

@srinureddy1642 

not easy to merge as each catalog will have n number of variables and different visibility etc conditions

I will suggest to discuss this 1st with your customer and consolidate the variables for that single catalog item

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

harshavinay
Tera Contributor

If you are fine with having the variables in the individual catalog items as variable sets, it would make things easier for you. All you have to do is add the variable sets in the master catalog item and display the relevant variable sets based on the selected item. You should consider the overhead on the client side if you were to create a UI policy for each selection. You could try having an onChange Client script to control the visibility in a single client script.

Any client-side logic required on the individual catalog item can also be defined in the variable set allowing you to retain the functionality on the master item too.