Configuration Inquiry: Displaying Full 'Display Name' in System Fields ('Created By', 'Updated By').
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a month ago
By default, the 'Created By', 'Updated By', and 'Opened By' fields store the username. However, I want to display the full 'Display Name' instead.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
ServiceNow: Display 'Display Name' Instead of Username for Created By / Updated By / Opened By
-------------------------------------------------
Overview
-------------------------------------------------
By default, 'Created by', 'Updated by', and 'Opened by' are reference fields to sys_user.
They display the user_name (login ID). To show the full display name (Name field), there are multiple safe options.
-------------------------------------------------
Option 1 — Change Display Field of sys_user (Global Impact)
-------------------------------------------------
1. Navigate to System Definition → Tables
2. Open the sys_user table record.
3. Change the Display field from 'User ID' to 'Name'.
4. Save.
Result:
All references to sys_user (Created by, Updated by, Assigned to, etc.) display the full Name globally.
Caution:
- Affects all user reference fields.
- Some integrations/scripts expecting user_name may see different labels.
- Recommended only if you want full names platform-wide.
-------------------------------------------------
Option 2 — Change Display Only for Specific Fields
-------------------------------------------------
Use Dictionary attributes to override the default display for selected fields.
Steps:
1. Go to System Definition → Dictionary.
2. Open the field record (sys_created_by, sys_updated_by, opened_by).
3. Add or modify the attributes:
ref_ac_columns=name
or
ref_ac_display_value=true
4. Save.
Result:
Those specific fields show the user’s Name in UI forms and lists.
-------------------------------------------------
Option 3 — Create Calculated Display Fields
-------------------------------------------------
If you don’t want to modify reference behavior, create a calculated string field for display.
Example Calculation:
(function() {
var user = new GlideRecord('sys_user');
if (current.sys_created_by && user.get('user_name', current.sys_created_by))
return user.name;
return current.sys_created_by;
})();
Result:
Use this field (e.g., created_by_name) in lists or reports.
-------------------------------------------------
Option 4 — Client Script (Form Only)
-------------------------------------------------
Add an onLoad Client Script:
function onLoad() {
var createdBy = g_form.getValue('sys_created_by');
var ga = new GlideAjax('UserInfoAjax');
ga.addParam('sysparm_name', 'getFullName');
ga.addParam('sysparm_user', createdBy);
ga.getXMLAnswer(function(name) {
if (name)
g_form.setValue('sys_created_by', name);
});
}
Script Include (Client Callable):
var UserInfoAjax = Class.create();
UserInfoAjax.prototype = Object.extendsObject(AbstractAjaxProcessor, {
getFullName: function() {
var u = new GlideRecord('sys_user');
if (u.get('user_name', this.getParameter('sysparm_user')))
return u.name;
return this.getParameter('sysparm_user');
}
});
Result:
Dynamically replaces the displayed username with the full name on the form.
-------------------------------------------------
Summary
-------------------------------------------------
| Method | Scope | Recommended | Notes |
|---------|--------|-------------|-------|
| Change Display Field | Global | ✅ | All sys_user references |
| Dictionary Attribute | Field-specific | ✅ | Safe, UI-only override |
| Calculated Field | Per table | ✅ | Ideal for reports/exports |
| Client Script | Form only | ⚙️ | Dynamic display only |
-------------------------------------------------
Best Practice
-------------------------------------------------
- For a few fields → Use Dictionary attribute `ref_ac_columns=name`.
- For global full names → Change sys_user Display field to 'Name'.
