Skip to page contentSkip to chat
ServiceNow support
    • Community
      Ask questions, give advice, and connect with fellow ServiceNow professionals.
      Developer
      Build, test, and deploy applications
      Documentation
      Find detailed information about ServiceNow products, apps, features, and releases.
      Impact
      Accelerate ROI and amplify your expertise.
      Learning
      Build skills with instructor-led and online training.
      Partner
      Grow your business with promotions, news, and marketing tools
      ServiceNow
      Learn about ServiceNow products & solutions.
      Store
      Download certified apps and integrations that complement ServiceNow.
      Support
      Manage your instances, access self-help, and get technical support.
Why doesn't getDisplayValue() obey Dictionary Overrides? - Support and Troubleshooting
  • >
  • Knowledge Base
  • >
  • Support and Troubleshooting (Knowledge Base)
  • >
  • Why doesn't getDisplayValue() obey Dictionary Overrides?
KB0714258

Why doesn't getDisplayValue() obey Dictionary Overrides?


836 Views Last updated : Aug 19, 2025 public Copy Permalink
KB Summary by Now Assist

Issue

Symptoms


It does, but when you have Dictionary Overrides for Display Value in place on extended tables like the CMDB, you expect using getDisplayValue() to give you the Display value specific to that record's Class (sys_class_name).

e.g. You may have a custom CI Class in the CMDB, where instead of using "Name", you wish for that CI to displayed with the value of some other field, maybe Asset Tag. But your scripts continue to return the CI 'Name' from this function.

Release


All.

Cause


You may be using the wrong class when you declare the GlideRecord. The Display value is taken from the GlideRecord object, not the specific record within that.

Resolution


Use the exact same class for the GlideRecord as of the record.

e.g. 53958ff0c0a801640171ec76aa0c8f86 is the sys_id of a Linux Server (sys_class_name=cmdb_ci_linux_server) in the Demo Data.

The cmdb.asset_tag field has had a Dictionary Override added for that Linux Server class, with 'Override Display' ticked.

var dave = new GlideRecord('cmdb_ci'); // This is the top level table for IT-based CIs. 
dave.get('53958ff0c0a801640171ec76aa0c8f86'); 
gs.print(dave.getDisplayValue()); // This will use 'name' because that is still what cmdb_ci defaults to.

output 
*** Script: lnux100 

var dave = new GlideRecord('cmdb_ci_linux_server'); // this is the actual class of this record
dave.get('53958ff0c0a801640171ec76aa0c8f86'); 
gs.print(dave.getDisplayValue());  // This will use asset_tag, because it will now use the cmdb_ci_linux_server specific override

output 
*** Script: P1000165 

 


The world works with ServiceNow.

Sign in for more! There's more content available only to authenticated users Sign in for more!
Did this KB article help you?
Did this KB article help you?

How would you rate your Now Support digital experience?

*

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

What can we improve? Please select all that apply.

What are we doing well? Please select all that apply.

Tell us more

*

Do you expect a response from this feedback?

  • Terms and conditions
  • Privacy statement
  • GDPR
  • Cookie policy
  • © 2025 ServiceNow. All rights reserved.