Send email to everyone with the same site

I have a main table that has a lot of lines of contact information with an email column and a site column.  I have another table named messages that I use as a trigger to send an email out with a message when the person chooses yes to send massage field. The two tables are joined by the field "School".  What I would like to do is click a dropdown and then send an email to anyone that has that school I just selected. My form based on the messages table looks like this

Tragertt_0-1663256689705.png

I want to be able to send a message to all people that have the site I selected on this form. Any ideas the code to do this? 

 

Solved Solved
0 5 105
1 ACCEPTED SOLUTION

You would use an OR() inside of the SELECT() to further filter rows.  You haven't said on which table this "unverified" column lives nor what type of column it is. 

Assuming it is in the same table and is a YES/NO column, the expression would be something like this:

SELECT( Main Table[Email], OR([Site] = [_THISROW].[School], [Unverified?] = "Yes"))

 

View solution in original post

5 REPLIES 5

In your automation where you are sending the email, you have available the properties "To", "CC" and "BCC" to provide a list of email  addresses for recipients.

In your case the expression you would want to use would be something similar to:

SELECT( Main Table[Email], [Site] = [_THISROW].[School])

 replace table and column names with those from your app.

That worked perfectly but i need one more criteria, I need to send to the site selected and also send to anyone flagged as unverified with a field named unverified, any ideas how I could do that?

You would use an OR() inside of the SELECT() to further filter rows.  You haven't said on which table this "unverified" column lives nor what type of column it is. 

Assuming it is in the same table and is a YES/NO column, the expression would be something like this:

SELECT( Main Table[Email], OR([Site] = [_THISROW].[School], [Unverified?] = "Yes"))

 

That also worked but my criteria was off, I need to send to the site selected and anyone that is flagged unverified = yes. Does this work?

SELECT( Main[E-mail], AND([Site Name] = [_THISROW].[Site Name], [Unverified] = "Yes" ))

Yes, if your intention is that the person meets both criteria.

Top Labels in this Space