Skip to content

Instantly share code, notes, and snippets.

@jbutz
Created January 31, 2014 21:08
Show Gist options
  • Save jbutz/8743166 to your computer and use it in GitHub Desktop.
Save jbutz/8743166 to your computer and use it in GitHub Desktop.
ServiceNow - Workflow E-Mails
current.variables['variable_name'].getGlideObject().getDisplayValue(); // For the displayed value
current.variables['variable_name'].getGlideObject().getValue(); // For the real value (sys_id when it is a reference)
<mail_script>
template.print( current.variables['primary_contact'].getGlideObject().getDisplayValue() );
</mail_script>
<mail_script>
var item_var = function(key)
{
template.print( current.variables[key].getGlideObject().getDisplayValue() );
}
</mail_script>
... blah blah blah ...
<strong>Variable One:</strong><mail_script>item_var('var1')</mail_script>
<strong>Variable Two:</strong><mail_script>item_var('var2')</mail_script>
<strong>Variable Three:</strong><mail_script>item_var('var3')</mail_script>
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment