Send email to a group in flow designer

Sakshi28
ServiceNow Employee
ServiceNow Employee

Is it possible to send an email to a group in Flow Designer from Send Email action?

 

7 REPLIES 7

Alberto Consonn
ServiceNow Employee
ServiceNow Employee

Hi Sakshi,

it's possible, just look this well-done documentation:

Send Email action

Here a good example on how to do it:

Example of Send email action to a Group

Hope this will fit your need.

Please, remember to mark Correct or Helpful if you find my response useful.

Cheers
Alberto

Thanks Alberto for your reply. In these links, we are getting the group from the trigger pill record.

I need to send it to a separate group which cannot be obtained from the trigger pill.

For example, employee is submitting an expense report. On expense report submission, a group of approvers need to be notified. These approvers are in a group which cannot be obtained from the employee record. Can we add the group the email recipients list?

 

I've achieved something similar by doing a lookup on the approval table prior to sending the notification email, then you can use the approval lookup data pill to fill your email.

 

This becomes necessary because the approval is just a related list/relation to the record.

nagydan2
Tera Contributor

Unbelievably no solution to this.... Until now! 🙂

Drop down the Fx button next to "To" in the Send Email Action step.

 

Put this in the script:

//Get email addresses of SAM group members
//"SAM" groups SysID is: "8111195edb5333300b79d44444b961998"".
var samARR = [];
var groupGR = new GlideRecord('sys_user_grmember');
groupGR.addQuery("group", "8111195edb5333300b79d44444b961998");
groupGR.query();
while(groupGR.next())
{
samARR.push(groupGR.user.email);
}
var SAMstr = samARR.join(',');
return SAMstr;​
 
 
 
Last step: Mark this useful, if it was :)))