one or more email address was invalid,(local address containing illegal character
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
Hi
I am getting below error in test but same script is working in dev , could you please help on this
email script I am using in send email
var recepients = fd_data._1__get_catalog_variables.select_list_of_users_to_send_emails;
var groupmembers = new GlideRecord('sys_user_grmember');
groupmembers.addQuery('group','4809499747cb4e90c996889d416d43d0'); // KA_Rating_ApplicationGroup sys_id
groupmembers.query();
while(groupmembers.next())
{
recepients += ","+ groupmembers.user;
}
return recepients;
Could you please help on this, Thank you!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
Hi,
Did you try to see what is returned from this function?
Sometime the GlideRecord will not convert to sys_id, so you can explicitly mention like below
recepients += ","+ groupmembers.user.sys_id.toString();
Palani
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago - last edited 59m ago
try below:
var arr = [];
var recepients = fd_data._1__get_catalog_variables.select_list_of_users_to_send_emails;
var groupmembers = new GlideRecord('sys_user_grmember');
groupmembers.addQuery('group','4809499747cb4e90c996889d416d43d0'); // KA_Rating_ApplicationGroup sys_id
groupmembers.query();
while(groupmembers.next())
{
arr.push(groupmembers.user.toString());
}
arr.push(recepients);
return arr;
Your current code should also work , you need to check any of the users which are in the group or your list collector does not have invalid email like missing @ or having illegal; characters like /
Raghav
MVP 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
31m ago
variable "select_list_of_users_to_send_emails" is of what type?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
⨠Certified Technical Architect || ⨠9x ServiceNow MVP || ⨠ServiceNow Community Leader