Set Variable Label in Service Portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-13-2017 06:38 AM
Has anyone figured out how to set a variable Label in the Service Portal?
Mark's (ServiceNowGuru) solution doesn't work for the Service Portal and g_form.setLabelOf doesn't work for the Service Catalog.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-13-2017 06:47 AM
Hi Steven,
Please try below threads, you can try to modify as per your requirements.
Change the variable's label dynamically
How do I modify the Help Label of Form Fields With Client Scripts?
Hope these help you.
Thanks,
Rohith.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-13-2017 06:48 AM
Rohith,
I've tried those things, but they don't work in the Service Portal.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-14-2017 07:07 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2018 10:57 PM
For Service Catalog you can use:
var field = 'requested_for'; // requested_for is the database name for the variable
var labelElement = $('label_' + g_form.getControl(field).id).select('label')[0];
labelElement.innerHTML = 'Requested By'; // Requested By is the label name.
For Service Portal setLabelOf works fine.