How to add multiple users from a form in email CC via inbound email action
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2025 05:35 AM
Hi Experts,
We have a requirement to add multiple users in email CC via inbound email action. Tried the below code, but not working. Please help me to overcome this requirement.
Action Script as below:
/*
var ccUsers = ['u_business_sme', 'u_it_manager', 'u_additional_it_manager'];
for (var i = 0; i < ccUsers.length; i++); {
var field = ccUsers[i];
var userID = current.getValue(field);
if (userID) {
var user = new GlideRecord('sys_user');
if (user.get(userID)) {
email.addAddress('cc', user.email, user.name);
gs.log("User CC emails: " + user.email);
}
}
}
*/
if(current.u_business_sme){
var bsme = new GlideRecord('sys_user');
if(bsme.get(current.u_business_sme)){
email.addAddress('cc', bsme.email, bsme.name);
}
}
Thanks, Jay
1 REPLY 1

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2025 08:06 AM
You can try below approach
var users_sysids = ['123456789', '987654321']; //store the user sysids in array
var user = new GlideRecord("sys_user");
user.addQuery("sys_id", users_sysids);
user.addQuery("email","!=","");
user.query();
while(user.next()){
email.addAddress("cc", user.email, user.getDisplayValue());
}}
Accept the solution and mark as helpful if it does, to benefit future readers.
Regards,
Sumanth