The CreatorCon Call for Content is officially open! Get started here.

catalog cilent script

nameisnani
Mega Sage

 

Hi Team , 

 

can anyone please help me here .

 

For a Particular catalog item , I have to change label 'Description' to >> 'Justfication' . 

 

NOTE - The variable ' Description ' we are using from variable set . If we change in variable set means it will effect for all the catalogs . 

 

so can any one please provide me cilent script .

 

nameisnani_0-1715314343907.png

 

Thanks in advance 

 

 

 

1 ACCEPTED SOLUTION

Vrushali  Kolte
Mega Sage

Hello @nameisnani ,

 

You can create an on load client script on variable set, and write below code:

 

if(g_form.getUniqueValue() == 'sys_id of cat item'){ //sys_id of catalog item for which you want to change the label
   g_form.setLabelOf('Description', 'Justification');
}

This code will only change the label of variable for particular catalog item.

 

If my answer solves your query then please mark it as Accepted✔️ and Helpful👍 based on the impact.

View solution in original post

4 REPLIES 4

Amit Verma
Kilo Patron
Kilo Patron

Hi @nameisnani 

 

Refer below link for the solution :

https://www.servicenow.com/community/service-management-forum/change-label-for-catalog-variable/m-p/...

 

Thanks and Regards

Amit Verma


Please mark this response as correct and helpful if it assisted you with your question.

Vrushali  Kolte
Mega Sage

Hello @nameisnani ,

 

You can create an on load client script on variable set, and write below code:

 

if(g_form.getUniqueValue() == 'sys_id of cat item'){ //sys_id of catalog item for which you want to change the label
   g_form.setLabelOf('Description', 'Justification');
}

This code will only change the label of variable for particular catalog item.

 

If my answer solves your query then please mark it as Accepted✔️ and Helpful👍 based on the impact.

Community Alums
Not applicable

Hi @nameisnani ,

Please create a onLoad client script and add below code 

g_form.setLabelOf('Description', 'Justfication');

 

Please mark my answer correct and helpful if this works for you

Thanks and Regards 

Sarthak

nameisnani
Mega Sage

HI @Community Alums

could you please provide complete script