set variable name in variable set based on catalog item
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2023 01:06 AM
I have a variable set having one of the variables as 'Phone number'. This variable set is used in many catalog items. I have created a new catalog item where this variable set is used but for this particular variable i need to have a different name (for eg. Internal Phone Number).
So I do not want to create a new variable but instead want to use same variable but with different name and annotation.
Please help me out to find a suitable solution for this requirement. This is an urgent requirement.
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2023 03:07 AM
Hi @Shruti Chennuri ,
I don't believe that would be possible, you will need to create a new variable. or you can create a copy of the variable set and in the newly copied update the phone number field.
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2023 03:29 AM
Hi @Shruti Chennuri ,
You can use OnLoad client script
g_form.setLabelOf('your variable',"the label you want to set") ;
Feel free to mark correct, If I answered your query.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2023 05:26 AM
Hi Ujwala,
Thanks for quick reply. The above line of code is working. I want to change the help text also along with Label. Could you please suggest a way for the same.
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2023 05:31 AM
you can change the label & use script shared by Ujwala
But you cannot set help text dynamically using script
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader