I want to send email to multiple recipients by using notificaiton activity in workflow.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-14-2017 01:01 AM
I am fecthing recipients from different table so how to assign multiple sysid's to answer variable.
var answer = new Array();
var eventname = current.u_event.sys_id;
gs.addInfoMessage(eventname);
var evt = new GlideRecord('u_event_user_detail');
evt.addQuery('u_event', eventname);
evt.query();
while(evt.next())
{
answer .push(evt.u_user);
gs.addInfoMessage(evt.u_user);
}
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-14-2017 03:19 AM
Hi Swampnil,
I hope evt.u_user is the refference field.Can you try the below script and let me know if you stilling facing the issue.
var eventname = current.u_event.sys_id;
gs.addInfoMessage(eventname);
var evt = new GlideRecord('u_event_user_detail');
evt.addQuery('u_event', eventname);
evt.query();
while(evt.next())
{
var email=evt.u_user+','+email;
gs.addInfoMessage(evt.u_user);
}
var answer=email;
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-17-2017 11:10 PM
still its not working

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-14-2017 04:18 AM
can you replace the below line
answer .push(evt.u_user);
with
answer.push(evt.u_user.toString());
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-17-2017 11:09 PM
If i execute the code(which i posted in question) in background script then iam able to get the sys_id's of user here( answer .push(evt.u_user); )
according to wiki in notification activity if i assign user sys_id to answer variable mail will go to those users.
i am getting javascript native error