Common script for catalog

kiwi07
Tera Contributor

I have created four catalogs and each catalog i have to write an onLoad script however the code for the onload is same for all 4 catalogs , is it possible to reuse the same script in all 4 catalogs ?

2 ACCEPTED SOLUTIONS

SatyakiBose
Mega Sage

Hello @kiwi07 

You can create a variable set, and define the client scripts within the variable set.

Then you can use the same variable set on multiple catalog items, without having to write it for all catalog items individually.

You can also define UI policies, and variables within a variable set which are designed to be reused in other variable sets.

You can read more about variable sets here : https://docs.servicenow.com/bundle/tokyo-servicenow-platform/page/product/service-catalog-management...

 

 

View solution in original post

Laszlo Balla
ServiceNow Employee
ServiceNow Employee

Do you mean catalog items?

You can do this by creating a new variable set, and once saved, you will be able to define your onLoad Catalog Client Script within that Variable Set. Then you can simply map all your catalog items to this variable set via the "Included In" related list.

LaszloBalla_0-1676457321866.png

 

View solution in original post

2 REPLIES 2

SatyakiBose
Mega Sage

Hello @kiwi07 

You can create a variable set, and define the client scripts within the variable set.

Then you can use the same variable set on multiple catalog items, without having to write it for all catalog items individually.

You can also define UI policies, and variables within a variable set which are designed to be reused in other variable sets.

You can read more about variable sets here : https://docs.servicenow.com/bundle/tokyo-servicenow-platform/page/product/service-catalog-management...

 

 

Laszlo Balla
ServiceNow Employee
ServiceNow Employee

Do you mean catalog items?

You can do this by creating a new variable set, and once saved, you will be able to define your onLoad Catalog Client Script within that Variable Set. Then you can simply map all your catalog items to this variable set via the "Included In" related list.

LaszloBalla_0-1676457321866.png