How to Change the system language on the basis of user's preferred communication language?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā01-19-2021 03:58 AM
Scenario: There is a field "" in sys_user table and one field "Language" in system setting.
Expected solution: Need to change the system language on the basis of user's preferred communication language.
Example: If user's preferred communication language is FI then system language should automatically change to FI.
Please refer the attached pic.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā01-19-2021 04:30 AM
you can use after update BR on sys_user table
Condition: Language Changes
Script: please refer below link
How to change system language in script
Regards
Ankur
Ankur
⨠Certified Technical Architect || ⨠9x ServiceNow MVP || ⨠ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā01-19-2021 04:33 AM
Hi,
BR Script as per the link mentioned
I assume the preferred language has values such as
ES -> Spanish,
FR -> French and so on
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var util = new I18nUtils();
util.setLanguage(current.preferred_language);
})(current, previous);
Regards
Ankur
Ankur
⨠Certified Technical Architect || ⨠9x ServiceNow MVP || ⨠ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā01-19-2021 04:47 AM
Hi Ankur,
I tried this way but it's not changing system language.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā01-19-2021 05:04 AM
Hi,
when I tried this script in background script it worked fine
var util = new I18nUtils();
util.setLanguage('es'); // es means spanish
Regards
Ankur
Ankur
⨠Certified Technical Architect || ⨠9x ServiceNow MVP || ⨠ServiceNow Community Leader