Localization Issue in Notifications Based on Account Language/Region
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2025 03:07 AM - edited 06-13-2025 03:27 AM
Hi everyone,
I’m facing an issue where the resolution code in my notifications is not being displayed in the correct language. I have resolution codes in multiple languages, and these are based on the Account’s preferred language or Region.
Here’s the scenario:
If the region is Germany, the resolution code should display in German.
However, in the notification, the resolution code is showing in English despite the region being set to Germany.
I’ve tried the following placeholders in the notification template:
${resolution_code.label}
${resolution_code.getValue()}
${resolution_code.getDisplayValue()}
None of these worked to display the localized resolution code in the correct language.
Below is my email Script code:
var account = current.account;
var lang = account.u_language;
if (!lang || lang.trim() === '') {
var region = account.u_region + '';
var regionLangMap = {
'Germany': 'de',
'Netherlands': 'nl',
'UK': 'en'
};
lang = regionLangMap[account.u_region] || 'en';
}
gs.setSessionLanguage(lang);
var resCodeDisplay = current.resolution_code.getDisplayValue();
resCodeDisplay;
I am calling this email script in my notification body:
Lösungs-Code: ${mail_script:resolution_code_basedon_region}
How ever, when I am doing preview, even though resolution code exists, it is showing as empty
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2025 03:37 AM
notification is on which table?
resolution code is drop down? If it's drop down then did you create choices in other language?
share some screenshots
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2025 03:52 AM
Notification is on Case table(sn_customerservice_case).
Yes, I have created choices in other languages as well
below are in Germany
below codes are in english
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2025 04:21 AM
pass language as parameter to getDisplayValue() and it should fetch in correct language
For Global Scope
For Scoped app - getDisplayValueLang()
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2025 04:27 AM
my updated code is
scope is customer service
(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */ event) {
// Get account from the current task or context
var account = current.account;
var lang = account.u_language;
if (!lang || lang.trim() === '') {
var region = account.u_region + '';
var regionLangMap = {
'Germany': 'de',
'Netherlands': 'nl',
'UK': 'en'
};
lang = regionLangMap[account.u_region] || 'en';
}
//gs.setSessionLanguage(lang);
var resCodeDisplay = current.resolution_code.getDisplayValueLang(lang);
template.print('Resolution code is' + resCodeDisplay);
})(current, template, email, email_action, event);