How to customize user name appearance in header bar?

sumeet_n
Kilo Guru

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.?

9 REPLIES 9

<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.


Weird! It just doesn't work for me! Tried it on demo001.



Also tried to relogin.


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.



ess.png


Oh okay i got it, but i want the change to be seen in below screen, not the CMS portal page. Do you know how to modify below name?



find_real_file.png


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