How can I retrieve the language on a specific user in script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-01-2022 07:15 AM
Hi all,
I know that the script gs.getSession().getLanguage() allow to retrieve the current user's language. But I want to retrieve the language of a specific user in script. Example, How can I retrieve the Fred LUDDY 's language in script ?
Thanks in advance,
Carole
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-01-2022 07:18 AM
You can use below script:
gs.getUser().getLanguage();
Feel free to mark correct, If I answered your query.
Will be helpful for future visitors looking for similar questions š
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-01-2022 07:30 AM
This is for the current user, I want to get the specfic language of another user

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-01-2022 07:46 AM
You need to glide the user table and get the information.
var lng = new GlideRecord("sys_user");
if(lng.get('sys_id_of_the_user')){
lng.getValue("preferred_language");
}
Aman Kumar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā08-14-2024 09:31 AM
var userId = "some_sys_id";
var languageCode = gs.getUser().getUserByID(userId).getLanguage();