How to customize user name appearance in header bar?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-08-2015 11:21 PM
For example, in any demo instance when we log in as admin it says "System Administrator". What if i want to make it look some other way round eg: "Administrator System" / UserID / anything else from user record.?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-09-2015 01:21 AM
<j:if test="${!gs.getUser().isXML()}">
<a href="profile.do" title="${gs.getMessage('My Profile')}" aria-label="${gs.getMessage('My Profile')}"><b>${SNC.GlideHTMLSanitizer.sanitize(gs.getUserName())}</b></a>$[SP]$[SP]|$[SP]
</j:if>
<j:if test="${gs.getUser().isXML()}">
<b>${SNC.GlideHTMLSanitizer.sanitize(gs.getUserName())}</b>$[SP]$[SP]|$[SP]
</j:if>
Tried this and it works for me. Instead of gs.getUserDisplayName(), replace it with gs.getUserName() and you should see the user id instead of name.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-09-2015 01:43 AM
Weird! It just doesn't work for me! Tried it on demo001.
Also tried to relogin.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-09-2015 01:50 AM
HI Sumeet,
It works on demo001. Just logged onto Login | ESS Portal and I see admin instead of system administrator.
Try refreshing the browser cache once.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-09-2015 02:01 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-09-2015 05:38 AM
Hi Sumeet,
I'm not sure if you can achieve this on the native application side, this is being rendered through UI Template which uses :
$[jvar_session.getFullName()]
To understand more on getFullName( ), please refer: https://<instance-name>.service-now.com/scripts/classes/GlideUser.js
Hope this help!
-Manjul