how to get user sub region if no variable name 'subregion ' available in given record producer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
7 hours ago
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
6 hours ago
Hi @suryateja07
To get a user's sub-region by dot-walking, you must traverse through the user's Location (cmn_location) table, as the standard sys_user record typically only holds top-level location references rather than a direct "sub-region" field
e.g if you are looking for user city to be keep in sub region , you can take help from this sample script.
var gr = new GlideRecord('sys_user');
if (gr.get('USER_SYS_ID_HERE'))// Replace with actual user sys_id
{
var userCity = gr.location.city.toString();
gs.info('The user\'s city is: ' + userCity);
}
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
6 hours ago
Yes this will work but my question is I want to get sub region in client script to hide some of the options based on the condition.