Session language is not working in email script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2024 01:04 AM
Hello All,
I am experiencing an unwanted issue. I have a multi lingual condition on notification and email script written on the body of the email.
I have two languages French and English.
Whenever we are changing our preference language to French and triggering the notification, it is by passing the French logic and sending the English notification. Earlier it was all working good. I tried to check with logs and even the logs are bypassing the French logic.
Currently we upgrade our instance to Xanadu but the same issue is experienced on other instances which are not upgraded.
Can any one help to debug this issue.
For reference, we are using below code on the email script :

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2024 01:12 AM
Hi @Souvick6917 ,
This KB should help you : https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0784502
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2024 03:48 AM
Hi Sandeep,
As per our configuration we set the mail script to identify session language either as French(fr) or English(en), but everytime it is bypassing the French condition and triggering email in English language.
Regards
Souvick
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2024 01:24 AM
You could use an OOB feature for this: https://www.servicenow.com/docs/bundle/xanadu-platform-administration/page/administer/notification/c...
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2024 04:33 AM
Hi @Souvick6917 ,
I’m facing an issue with multilingual notifications after upgrading to Xanadu. The session language preference (gs.getSession().getLanguage()) is not being recognized, and notifications always send the English version, even when the language is set to French. This issue persists across non-upgraded instances as well.
Debugging Steps Tried:
- Checked logs; gs.getSession().getLanguage() always returns English.
- Verified user language preference is correctly set to French.
- Confirmed notification trigger logic and email script.
Replaced gs.getSession().getLanguage() with gs.getUser().getPreference("language") for better reliability. Updated script:
if (gs.getUser().getPreference("language") == "fr") {
// French content
} else {
// English content
}