cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
gemma
Helper I
Helper I

Send email with HTML table using contact information in a different Excel file

Good morning Flow Experts!

I'd like to use Flow to email a subset of a larger Excel table to different users based on a Location value. The email addresses are saved in a separate Excel file. Thanks to the help from some users last week, I was able to create separate HTML tables, but now I'm struggling to get the email part of the project right. 

After the Create HTML table step, I have added the Send an email step, but now it sends an email for every location to every email address listed! I have also tried to change the Apply to each output to "union(variables('Location'), variables('Location'))" because I thought it might be useful to "join" the table with the Email Information in, but I received a different error for that. 

Can you please provide me with other things I can try? Do I need to join the tables before the Create HTML table step? 

Email Tables1.PNG

Email Tables2.PNG

Here are data samples - I have two tables, and each of them have a Location field. I'd like to take the information from the Sample Data and email it to the corresponding Email address.

Sample DataSample Data

Sample Email ListSample Email List

4 REPLIES 4
v-alzhan-msft
Community Support
Community Support

Hi @gemma ,

 

Could you please share a full screenshot of the configuration of your flow?

Would all the location have the same Email?

 

Best regards,

Alice       

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-alzhan-msft !

 

Thank you for getting back to me. All the locations will have different email addresses, but I've plugged in my email address for now for testing purposes!

 

Here are screenshots of all of the elements related to creating the table and sending the emails.  

Email Tables1.PNGEmail Tables2.PNGEmail Tables3.PNG

Hi @v-alzhan-msft !

 

I've made some progress, but now I'm stuck on a different part of the flow. I've successfully joined my two tables, but I'm having trouble filtering it by location, especially now that my Location variable is a multi-dimensional array instead of a single item. How can I change my Apply to Each expression to fix this issue?

 

@v-bacao-msft, thank you so much for helping me with a similar issue last week! Can you also offer me some advice with this? 

 

Email Tables1.PNG

Email Tables2.PNG

Email Tables3.PNG

Email Tables4.PNG

Hi!

I'm slowly working through my issue, and I'm now able to get the table that I want! I'm on the Send and Email step, and I'd like to put in the email address from the Create HTML Table step. What kind of expression can I use to get the email address from the table? 

 

I'm using this expression: 

body('Create_HTML_table_-_Filter_Inventory_by_Yard')?['Email']
 
Here's my flow followed by the results/error message I'm receiving! 
Email Tables5.PNGEmail Tables6.PNG

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (2,234)