Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

I want to send email to multiple recipients by using notificaiton activity in workflow.

Swapnil Kumar
Tera Expert

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);

  }

4 REPLIES 4

kalyan778
Mega Guru

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


still its not working


dvp
Mega Sage

can you replace the below line


answer .push(evt.u_user);



with



answer.push(evt.u_user.toString());


Swapnil Kumar
Tera Expert

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