- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2022 05:26 AM
Hi
I have a glide list in the form which is a list of user groups.
I need to get all user's email address from the groups in the list by script (business rule or something), any Idea to do that?
Please advice. Thanks
Solved! Go to Solution.
- Labels:
-
Notifications

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2022 05:42 AM
You can try someting as below as a business rule on required table that runs before update with script as below
(function executeRule(current, previous /*null when async*/ ) {
var getlistis = current.abcd.split(','); //replace abcd with your glidelist field name
for (var i = 0; i < getlistis.length; i++) {
var grmembers = new GlideRecord('sys_user_grmember');
grmembers.addQuery('group', getlistis[i]);
grmembers.query();
while (grmembers.next()) {
current.description = current.description + ',' + grmembers.user.getDisplayValue();
//replace current.description with value you want to get the users list on
}
}
})(current, previous);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2022 05:42 AM
You can try someting as below as a business rule on required table that runs before update with script as below
(function executeRule(current, previous /*null when async*/ ) {
var getlistis = current.abcd.split(','); //replace abcd with your glidelist field name
for (var i = 0; i < getlistis.length; i++) {
var grmembers = new GlideRecord('sys_user_grmember');
grmembers.addQuery('group', getlistis[i]);
grmembers.query();
while (grmembers.next()) {
current.description = current.description + ',' + grmembers.user.getDisplayValue();
//replace current.description with value you want to get the users list on
}
}
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2022 06:10 AM
Jaspal
Thanks, Your script is very helpful.
I just modified a little bit adding ".email" to get user's email information.
Thanks a lot!
current.description = current.description + ',' + grmembers.user.email.getDisplayValue();