Hi,
As stated, it is pretty straightforward but requires a handful of steps and easy to get lost on your first try. After doing this once though, you will be able to repeat my memory (mostly).
Here's the steps. In my example, I also send an email attachment of the rows as a CSV file. So my email body text contains a formatted html table of the same data but working with the attachment is typically the path forward but nice to see the data in the email directly.
Create two variables, shown below.
Next add an Append to array variable action. When you reference the dynamic content EMAIL from your excel table, this will automatically add the apply to each. Note: your excel file content must be in a table (not a range of worksheet data). That's how I use the List rows present in a table action.
Next add a compose with the union expression.
Next add a filter array action. Again, this will wrap itself in an apply to each loop when you add the dynamic content from your compose union action.
Next I am adding an html table do display the content of the attachment in the email body of the message as a table. Yours will probably only have one column Student name. The value is going to be the entered as an expression item()?['StudentName']
Same thing except for a csv table. I refer to the content from my filter array.
Next I create a file to send as an attachment. In my example, I just create a file name with a random number because the name of the file isn't necessarily relevant. The file content is the body of the csv table shown below.
Then I am formatting my html table with some light formatting, some spacing and a border. Basic but easy to understand and looks good in the email.
Last step, finally, sending the email. Here in the To: field, I refer to the current item in the loop with is my list or unique email addresses from the compose union action. The format table variable is my list of student names (for your example). And my attachment is my csv file.
In summary, there are two parts to this flow. The top portion sets up the flow, the second part loops through each unique email and sends the email.
Top:
Bottom:
------------------------------------------------
⭐ If this was helpful, please like and/or mark as a verified answer to help others find this too!
Always glad to help! 💯💯💯💯💯
Tom
Follow me on LinkedIn - Thomas Rice, PMP | LinkedIn