Wanting to send HTML table from Excel document to multiple users. I want each user, which are identified by email address column, to receive HTML table with only those rows that contain that individual's unique email address(one email per person). I was able to loop through and get the unique email addresses, but now need to send email with HTML table. I'm stuck on second Apply to Each-getting an error about "Apply to each must be parent for each scope." Need help with how to modify flow for error and complete flow to append table with rows for each person, and send to each user based on that user's email address. Thanks!
Solved! Go to Solution.
With respect, your flow has quite a bit of complexity that you do not need. I would suggest the following changes:
With those changes, you should be good to go.
I would recommend a different approach to this.
1) Sort the Excel Table by the email address column.
2) Create a variable to hold the last email address processed and initialize it with some value.
3) Create an array variable to hold the values for the HTML table.
4) Use an Apply to each Loop to process the rows. Check each row to see if it matches the last email variable. If it does append the information in the record to the HTML table array. If it doesn't then convert the array to an HTML table and send the email. Then re-initialize the HTML table array with the current row and update the last email variable with the current row email.
5) When you are all done with the Apply to Each Loop you will have one last email to send. So convert the HTML Table array to an Html Table and send it to the last email address variable address.
This way there is only one loop and you only process the emails once.
Can you tell me syntax for Union? Also not sure what to put in the field From of Select? I put Email and got an error saying it needed to be an array. I got an error on the union, so just needing help with that part also. Thank you!
Thank you for putting that together. That was awesomely helpful! Haven't put mine together yet, but that looks exactly like what I needed. Thanks again Paulie.
Paulie, Could you show how to add a personal salutation that comes from the firstName column in same excel file and the number of rows returned? So in the email body says something like Hi Bob, You have 7 items. I tried following the same logic and keep getting stuck. That was a great video BTW!
Yes, number of different ways to do it. If you just want to modify the flow you have already created on the basis of the video that I made you. Then it is probably easiest to do the following:
Then in a compose step you can use first() expression to get the first record from the filter array and that will contain their first name, salutation etc.
Check out the News & Announcements to learn more.
Participate in the Power Virtual Agents Community Challenge
Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.
DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.