How to email all members of a group

How to email all members of a group


Hi All,

I am fairly new to Outsystems. So your patience is appreciated.

I want the approval email to go out to all members of an approvers group that I have created. 

In the preparation of the email, I have iterated through the group members and have added them to a comma separated local text variable  Called "EmailList".

When i go over to the Processes screen, i want to pass this text variable(EmailList) to the "To" field of the email but it does not appear here. 

I included an input parameter to the email but i can only assign to a variable of the process . What am i doing wrong? How can i add send an email to addresses contained within this text variable?




Hello ashutosh-iddya

I'm not sure I understood well, but it seems that you are iterating the group to take the e-mail address in the "preparation" of the mail screen? 

If so, you are doing this in the wrong place. The correct place to do this is the screen action that will call the email widget (logic), as only at this place your variable will be available to be used inthe To/CC/BCC of the mail logical widget.

Than, even if it do not appear, if you open the expression editor in the To field, it will be available there.

The addresses are not passed to "inside" the mail widget (not to send them, any way). Just in the property "To", so they must be available before calling the email. In the example below, I create a Server Action to get the mails and return in a Text output parameter that I can use in the "To" property of the Send Email widget:

Eduardo Jauch


Hi Eduardo,

Thanks for your reply. 

That did work i moved the loop to the screen action and it did  have the text variable with all the email addresses.

This is what i was trying to do:

I was sending the email from the Process screen which I start on creation of a new form (as was suggested in a BPM example from the forge). Is this not the right design approach?

Is there a way to achieve the two things i am trying to do? 

Thanks again for your insight on this. Much appreciate it.


Hi Ashutosh,

I'm not sure what you want to achieve with the Application Submitted email activity there, do you want to send an email as the first activity of your process?

In regards with what you are doing, I'd say you need to compute the recipients of your NotifyApplicantApproved/Rejected:

  • as part of the screen logic for SendForApproval human activity; or
  • on the OnClose callback action for the SendForApproval human activity; or
  • in a user function you would call directly on the NotifyApplicantApproved/Rejected To properties

More info on BPT's Process Activities Callbacks here.

If you're just starting with BPT I strongly suggest you go through the online Master Class on Modelling Business Processes (BPT).

Hi Jorge,

Thanks for your reply.

I am starting an "Approval" process on submission of a form. So on create of a form, I kick off the process described in the image and notify the people in the approvers group via my first email "Application submitted".

Since i have to do a loop to build the emaillist, i have now moved this email to the "Save" action as was suggested by Eduardo.

Thanks for the link. I'll go through it.



Hi Ashutosh,

Please do go through the Master Class, from what you explained I believe you will have to adapt quite a bit your process... and the Master Class does go through a somewhat similar scenario to yours, if my memory doesn't fail me.