Expression to send emails from a list?

I am trying to solve a problem where an email automation can send a grouped emails data.
The goal is to send an email where the [Payroll Contact Email] will contain the data from all the [Email address]'s that have the same [Payroll Contact Email] in that row. To simplify, an email should go to testemail123@gmail.com containing the data from Jack, Kyrie, Godon, Connor because they all have the same [Payroll Contact Email]

The start expression I was using I could not get to work, to get the desired result. If anyone could help, I would very much appreciate it.

<<Start: Select(Employee Signup[Timestamp], [Payroll Contact Email]=>>

Screen Shot 2022-08-12 at 11.29.38 AM.png

 

0 2 161
2 REPLIES 2

The initial problem to solve is finding a way to iterate over the list of "Payroll Contact Email" 's so you can select the associated list of Employees with each email address.   

If you have a lot of these contact email addresses OR expect that this list will change frequently over time,  then I recommend creating a table with each Contact inserted as a row.  Then you can create a Scheduled Bot that runs with the "ForEachRowInTable" setting turned on.  It will iterate over each row in the Contact table sending it to the template in your email step.  The email template would use the email address from the row to pull the list of Employees to be reported on like this (using your example template SELECT):

 

<<Start: Select(Employee Signup[Timestamp], [Payroll Contact Email] = [_THISROW].[Contact Email Address]>>

As an alternative...

If you only have a few of these Contact email addresses and never expect that list to grow or change anytime soon, you can adjust the approach by creating a dedicated Bot and template for each "Payroll Contact Email" address.  In this case the Bot's "ForEachRowInTable" setting is turned off, you would copy your email template - one for each Contact Email and you would hard code the Employee SELECT on each template similar to this:

 

<<Start: Select(Employee Signup[Timestamp], [Payroll Contact Email] = "testemail123@gmail.com">>

 I hope this helps!

Hello @WillowMobileSys , 
Thanks for helping out. I tried using the first expression formula as the user's will change over time. Unfortunately, the email comes through as completely blank when using that formula.

Top Labels in this Space