cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
WasimChhipa
Frequent Visitor

How to send two different tables in one email to each recipient in the list

Hi

 

I have two datasets with same email ID in 2 different sheets as below.

 

1st Data Set. (This is Summary Mgr wise) 

 

NameTot1Tot2Tot3Email_ID
Mgr1149187133Mgr1@anyone.com
Mgr2192142127Mgr2@anyone.com
Mgr3177175126Mgr3@anyone.com
Mgr4109101125Mgr4@anyone.com
Mgr5146182168Mgr5@anyone.com

 

2nd data Set ( This is the List of Emp Mgr wise)

 

Name Tot1Tot2Tot3Email_ID
Emp1Mgr2149187133Mgr2@anyone.com
Emp2Mgr5192142127Mgr5@anyone.com
Emp3Mgr2177175126Mgr2@anyone.com
Emp4Mgr5109101125Mgr5@anyone.com
Emp5Mgr4146182168Mgr4@anyone.com
Emp6Mgr5168132131Mgr5@anyone.com
Emp7Mgr5166149107Mgr5@anyone.com
Emp8Mgr3198180151Mgr3@anyone.com
Emp9Mgr5147120193Mgr5@anyone.com
Emp10Mgr3118131160Mgr3@anyone.com
Emp11Mgr3166102136Mgr3@anyone.com
Emp12Mgr1153146163Mgr1@anyone.com
Emp13Mgr5194149179Mgr5@anyone.com
Emp14Mgr3108194169Mgr3@anyone.com
Emp15Mgr3184151154Mgr3@anyone.com

 

I want to send 2 different data sets in 1 email creating 1 single flow where Mgr's email ID is same in both data sets.

 

NameTot1Tot2Tot3Email_ID
Mgr2192142127Mgr2@anyone.com

 

Name Tot1Tot2Tot3Email_ID
Emp1Mgr2149187133Mgr2@anyone.com
Emp3Mgr2177175126Mgr2@anyone.com

 

Your immediate help will be highly appreciated.

 

Thanks in advance.

10 REPLIES 10
DamoBird365
Microsoft
Microsoft

Hi @WasimChhipa 

 

Are these data sets arrays?

 

I would supply the first array to an apply to each and then filter the 2nd within the apply to each (filter array) based on the emails matching.  Then create a table on the filter result and send an email.  The apply to each will run 5 times and send 5 emails with the filtered html table.

 

Damien

 

Please consider accepting my answer as a solution if it helps to solve your problem.

Cheers
Damien

Please take a look and subscribe to my YouTube Channel for more Power Platform ideas and concepts, or take a look at my website. Thanks

Hi Dam,

 

These are Data sets,

 

Actually I am new with Flows, & not much talented to understand your solutions.

 

Could you please help me with visuals or screenshots with process to carry out this flow.

 

It would be a great help of yours.

 

Thanks

Hi @WasimChhipa 

 

can you tell me what actions you are using to get the data? Is it from a list, excel an api? Then I can be more specific with a solution.

 

Damien

Hi Damien,

 

I am using Excel located on One Drive.

 

Thanks

Hi @WasimChhipa 

 

I've knocked up a quick demo, showing you how I would solve your problem using Excel, and Power Automate and a few tips on formatting and selecting columns for the HTML table.

 

Hopefully this is of use Send Unique Emails with HTML Table using Data from Excel #PowerAutomate - YouTube

 

***Updated the video to also include a demo of select / distinct values so that you could create your email without the first table of data***

 

Please consider accepting my answer as a solution if it helps to solve your problem.

Cheers
Damien

Please take a look and subscribe to my YouTube Channel for more Power Platform ideas and concepts, or take a look at my website. Thanks

 

Hi @WasimChhipa 

 

I've updated the original video as the sound wasn't great.  I've also included how to get distinct emails using select and union, which might be useful if you or anyone else don't have the first table.

 

Please let me know if this has solved your problems.

 

Damien

N_K
New Member

 

Hi Damien,

This is to bring to your notice that Filter array does not give an option to select the Email_ID field and by typing the expression item()?['Email_ID'] it returns blank output as [] (Screenshot#2). Is there any solution for this?

N_K_1-1644439265736.png

 

N_K_0-1644439213673.png

 

 

Hi @N_K 

 

Email_ID as the name of the fields in my example, it looks like you have the field named Email.  You would need to match our solution, including field names to use the exact same expressions OR change the expressions to match your field names. 

 

Damien

N_K
New Member

The problem was with the filter array. It was receiving the input correctly. However, the filter was not being applied properly. I could resolve it with expression items('Apply_to_Each')['Email'].

WasimChhipa
Frequent Visitor

Hi Dam,

 

I have a table called Process List with Reporting Manager & Manager.

 

I want to send an email with list of processes to Manager with respective Reporting Manager in CC.

 

Since both are duplicate & I am unable to find the way out, tried a lot.

 

It would be great help of yours if you can help automate this.

 

The table looks like this.

 

ProcessReporting Manager email IDManager Email ID
Process1RepMgr1@anyone.comMgr1@anyone.com
Process2RepMgr1@anyone.comMgr1@anyone.com
Process3RepMgr1@anyone.comMgr1@anyone.com
Process4RepMgr2@anyone.comMgr1@anyone.com
Process5RepMgr2@anyone.comMgr1@anyone.com
Process6RepMgr2@anyone.comMgr1@anyone.com
Process7RepMgr3@anyone.comMgr2@anyone.com
Process8RepMgr3@anyone.comMgr2@anyone.com
Process9RepMgr3@anyone.comMgr2@anyone.com
Process10RepMgr4@anyone.comMgr2@anyone.com
Process11RepMgr4@anyone.comMgr2@anyone.com
Process12RepMgr4@anyone.comMgr2@anyone.com

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (4,915)