Set user criteria on widget based on user language settings
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2023 11:18 AM
Hello,
I want to set a user criteria for my "Contact Us" widget based on the user language settings.
For eg: If it's French - Canada it's visible and if it's English, it's not visible. For the English one, it's the reverse
How can I achieve it?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-20-2023 02:01 AM - edited 09-20-2023 02:36 AM
Hi @kpanchal,
Below could still be useful, but I think not useable for preferred language.
Try an advanced script:
var user = new GlideRecord('sys_user');
user.get('user_name', user_id);
answer = user.getValue('preferred_language') == 'fr';
answer;
Take a look at this:
Extend user criteria (servicenow.com)
You can simply add fields from the user record to the user criteria, which can then be leveraged. This way you can take advantage of the preferred_language field on the user record.
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.