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.
Sort order of translated text field is always based on English language key value - Support and Troubleshooting
  • >
  • Knowledge Base
  • >
  • Support and Troubleshooting (Knowledge Base)
  • >
  • Sort order of translated text field is always based on English language key value
KB0746786

Sort order of translated text field is always based on English language key value


2102 Views Last updated : Jul 24, 2025 public Copy Permalink
KB Summary by Now Assist

Issue

The ordering of Service Catalog Categories was not as expected when non-English language was selected for the user's session. The categories were always displayed in the same order (as per English) instead of the order of the translated text.

The customer was using a customized widget that was retrieving a list of parent categories using the following server script:

var sc = new GlideRecord('sc_category');
sc.addQuery('sys_class_name', 'sc_category');
sc.addActiveQuery();
sc.orderBy('title');

The script is trying to order the query results based on the "title" field.

Release

This issue happens when Internationalization Language plugins are active.

Cause

To verify behavior I ran the same equivalent query code directly against the instance as background script:

var sc = new GlideRecord('sc_category');
sc.addQuery('sys_class_name', 'sc_category');
sc.addActiveQuery();
sc.orderBy('title');
sc.addQuery('sc_catalog', 'e0d08b13c3330100c8b837659bba8fb4');
sc.addQuery('parent', '');
sc.query();
while (sc.next()) {
  gs.print(sc.title)+"\n";
}

With the English language selected for the session, this was the output:

*** Script: Catalog & Model Management
*** Script: Click & Collect
*** Script: Employee Lifecycle
*** Script: Group & Role Provisioning in IT4You
*** Script: IT Internal Services
*** Script: My Workplace
*** Script: Rentals
*** Script: Services

When German language was selected the script returned:

*** Script: Katalogverwaltung
*** Script: Click & Collect
*** Script: Mitarbeiter Lifecycle
*** Script: Gruppen & Rollenbereitstellung
*** Script: IT interne Services
*** Script: Mein Arbeitsplatz
*** Script: Verleihung
*** Script: Services

This confirms that the title field which is type "Translated Text" is being successfully translated but the ordering is always based on the English title text.

Resolution

The only way to modify the way that this is operating would be to modify the widget server code that implements your custom widget and populates the data property set with category data. For example, read the translated titles into an array and then implement your own custom sort logic to reorder it based on the translated text value and place it into the data structure in your desired order.

Related Links

This is not a Service Portal specific issue. It is a general issue related to trying to order the results of GlideRecord query based on the value of a translated text field.


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.