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.

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

5 REPLIES 5

Akshay Bhaskar
Kilo Sage

@Vrushali Kolte / @Amit Verma

The script works brilliantly in the catalog form (portal) but the same script fails to run within the RITM variables. Is this something you've encountered as well? 


Regards,

Akshay