Skip to content

Instantly share code, notes, and snippets.

@mattmetten
Last active August 29, 2015 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattmetten/47cf136dee69e53572fa to your computer and use it in GitHub Desktop.
Save mattmetten/47cf136dee69e53572fa to your computer and use it in GitHub Desktop.
<!--Do a look-up and find the First Name of the current user -->
<g:evaluate>
var name = gs.getUser().getFirstName()
if(name == ''){
<!--If there is no value for First Name, then query the sys_user table and get the user_name value -->
var usr = new GlideRecord('sys_user');
usr.get(gs.getUserID());
name = usr.user_name.getDisplayValue()
}
if(name == ''){
name ="empty";
}
</g:evaluate>
<!-- Wrap the actual value however you choose (i.e. H3 or p tags) -->
<div class="user_name">
${name}
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment