Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2023 12:44 AM
Hi, am trying to get user details in scoped application and using the following syntax:
var empid= gs.getUser().getRecord().getValue('employee_number');
It's perfectly working in global but not in scoped.
Any help will highly appreciated
Solved! Go to Solution.
1 ACCEPTED SOLUTION
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2023 01:54 AM
Hi @Aavi,
Please try this code :
var user_id = gs.getUser().getID();
var gr = new GlideRecord('sys_user');
gr.get(user_id);
var userSource = gr.getValue('employee_number');
var empid= userSource;
Please mark my answer as helpful if it serves your requirement.
Regards,
Aditya
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2023 01:59 AM
Hi @Aavi ,
I same script it will be available on the knowledge article. Which I have provided below.
If it helps please click Accept as Solution/hit the Thumb Icon.
ServiceNow Community MVP 2024.
Thanks,
Pavankumar
ServiceNow Community MVP 2024.
Thanks,
Pavankumar