show the list of email address of all the user
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2024 08:44 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2024 09:50 PM
you script is correct only.
not authorised - its due the session issue so please re-login or reload the page and execute the script it will work
to make more accurate add few query in your script like below
var grUser=new GlideRecord('sys_user');
grUser.addActiveQuery();
grUser.query();
while(grUser.next())
{
gs.print(grUser.email);
}
If my response proves useful, please indicate its helpfulness by selecting "Accept as Solution" and " Helpful."
Thanks,
BK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2024 09:57 PM
Hi @Anjali yadav1 check below code

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2024 09:59 PM
Additionally, use getValue rather than passing grUser.email which is GlideElement. You'll run into pass-by-reference issues if you use this logic to push glide record values to an array or other data type.
var grUser = new GlideRecord('sys_user');
grUser.query();
while (grUser.next()) {
gs.print(grUser.getValue('email'));
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2024 10:38 PM
Your script is correct! I ran the same in BS and got the results. See screenshot-
Regards,
Amit