- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2022 05:58 PM
I am using getDisplayValue() to get the label name of a field.
However, it is retrieved in English.
How can I get it in Japanese?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2022 07:10 PM
Can write a script include to get the choice labels in specified language and use that.
Example:
var ChoiceHelper2 = Class.create();
ChoiceHelper2.prototype = {
initialize: function() {
},
getChoice: function(table, value, lang) {
var grChoice = new GlideRecord('sys_choice');
grChoice.addQuery('name', table);
grChoice.addQuery('value', value);
grChoice.addQuery('language', lang);
grChoice.query();
if (grChoice.next()) {
return grChoice.label;
}
},
type: 'ChoiceHelper2'
};
Test:
var choiceHelper = new ChoiceHelper2();
var label = choiceHelper.getChoice('incident', 'request', 'ja');
gs.info(label);
Result:
*** Script: 要求
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2022 06:55 PM
Thank you.
I have already set the Japanese labels for the choices.
I am specifically using getDisplayValue() in the Scheduled script to get the label names of the choices.
The "Run as" in the Scheduled script is "Administrator".
The language setting for Administrator is "Japanese".
However, English labels are retrieved.
Is there a solution?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2022 07:10 PM
Can write a script include to get the choice labels in specified language and use that.
Example:
var ChoiceHelper2 = Class.create();
ChoiceHelper2.prototype = {
initialize: function() {
},
getChoice: function(table, value, lang) {
var grChoice = new GlideRecord('sys_choice');
grChoice.addQuery('name', table);
grChoice.addQuery('value', value);
grChoice.addQuery('language', lang);
grChoice.query();
if (grChoice.next()) {
return grChoice.label;
}
},
type: 'ChoiceHelper2'
};
Test:
var choiceHelper = new ChoiceHelper2();
var label = choiceHelper.getChoice('incident', 'request', 'ja');
gs.info(label);
Result:
*** Script: 要求
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2022 09:38 PM
Thank you! It worked fine.