Change label of catalog item variable in service catalog (not service portal

Eli Guttman
Tera Guru

Hi,

We have a catalog item which is available in both service portal and also in the regular service catalog (not service portal).

We have a requirement that according to certain conditions, the label of variable will be changed.

This can be achilved ealiry using the g_form.setLabelOf function - but this function works only on Service portal and not in the service catalog.

This is from the product document page: https://docs.servicenow.com/bundle/jakarta-application-development/page/app-store/dev_portal/API_ref...

 

find_real_file.png

 

Anyone know how can we change the variable label?

3 REPLIES 3

Alberto Consonn
ServiceNow Employee
ServiceNow Employee

Hi,

try to use the script mentioned in the article below (refer to paragraph Changing the label of a catalog variablešŸ˜ž

https://www.servicenowguru.com/system-ui/ui-scripts-system-ui/modifying-label-form-fields-client-scr...

If I have answered your question, please mark my response as correct so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.

Thank you

Cheers
Alberto

Any update on this?

If I have answered your question, please mark my response as correct so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.

Thank you

Cheers
Alberto

j3ssicav
Kilo Expert

A round-about way of solving this would be to make two variables with different names/ labels but that have the same data type, and to use UI policies to change which one shows depending on the conditions.