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

Create Scheduled Flows to send emails based on PIC and Trading Partner

Hi everyone, I want to create a scheduled flow that sends emails by filtering the 'PIC' and 'Trading Partner' extracted from a specific excel file.

 

As you can see from the table below, there is 'Email' and 'Vendor TP' Tabs. I would like the flow to send email by first filtering the 'Email' data, then the 'Vendor TP' data.

 

image.png

 

Currently, my flow is constructed as below. Can anyone help to see what needs to be modified for my flow ? Thank you.

 

image.png

image.png

image.png

image.png

image.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-yiwenxie-msft
Microsoft
Microsoft

Hi @NewbieHere1997 

 

In my understanding, you want to send an email to each user which is listed in ‘Email’ column only with his/her own ‘Vendor TP’ and other columns.

If yes, I’ve made a test and have run the flow successfully.

If no, sorry for my misunderstanding and please feel free to let me know.

 

The table in my excel is:

3.12-2.PNG

 

The result of my flow in outlook is:

3.12-3.PNG3.12-4.PNG3.12-5.PNG

 

The following flow is for your reference:

3.12-6.PNG

 

The detailed steps for storing all the de-duplicated values of ‘Email’ column in an array variable are:

3.12-7.PNG

 

The detailed step of getting all the rows for each de-duplicated email is:

3.12-8.PNG

The expression used:

union(variables('de-duplicated emails'),variables('de-duplicated emails'))

 

For more info about the functions:

union()variables()

 

‘Filter Query’:

Email eq '@{items('Apply_to_each_2')}'

 

For more info about filter query:

OData comparison operator reference - Azure Cognitive Search | Microsoft Docs

 

The detailed steps for creating an html table and sending an email are:

3.12-9.PNG

 

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

View solution in original post

4 REPLIES 4
v-yiwenxie-msft
Microsoft
Microsoft

Hi @NewbieHere1997 

 

Could you take a more detailed screenshot of 'Apply to each 3' and the 'Condition' in it?

Also, could you tell me whether the 'Apply to each 4' and 'Set variable' is in top-level or nested in 'Apply to each 2/3'? 

 

Just from the screenshots above, I couldn't figure out what you want to do with the flow. Can I guess you want the flow to send emails to each user who is listed in the 'Email' column and the data in each email are sorted by 'Vendor TP'? If I've misunderstood your need, could you please provide a more detailed description about your need?

 

Thanks.

 

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

NewbieHere1997
Frequent Visitor

Hello @v-yiwenxie-msft ,

 

Please find the requested screenshot below.

 

image.png

 

Also, the 'Apply to each 4' and 'Set variable' is nested in 'Apply to each2/3', as shown in screenshot below.

 

image.png

 

Regarding the flow, yes your interpretation is roughly correct. For example, if Person A's email is listed under 'Email' and against a few TP under 'Vendor TP', I want the flow to send only 1 email to Person A. If this is not possible, I would want the flow to send email to Person A based on sorting the 'Vendor TP'.

v-yiwenxie-msft
Microsoft
Microsoft

Hi @NewbieHere1997 

 

In my understanding, you want to send an email to each user which is listed in ‘Email’ column only with his/her own ‘Vendor TP’ and other columns.

If yes, I’ve made a test and have run the flow successfully.

If no, sorry for my misunderstanding and please feel free to let me know.

 

The table in my excel is:

3.12-2.PNG

 

The result of my flow in outlook is:

3.12-3.PNG3.12-4.PNG3.12-5.PNG

 

The following flow is for your reference:

3.12-6.PNG

 

The detailed steps for storing all the de-duplicated values of ‘Email’ column in an array variable are:

3.12-7.PNG

 

The detailed step of getting all the rows for each de-duplicated email is:

3.12-8.PNG

The expression used:

union(variables('de-duplicated emails'),variables('de-duplicated emails'))

 

For more info about the functions:

union()variables()

 

‘Filter Query’:

Email eq '@{items('Apply_to_each_2')}'

 

For more info about filter query:

OData comparison operator reference - Azure Cognitive Search | Microsoft Docs

 

The detailed steps for creating an html table and sending an email are:

3.12-9.PNG

 

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

NewbieHere1997
Frequent Visitor

Hi @v-yiwenxie-msft ,

 

I tried to run the flow that you provided, and the flow sent me 4 emails with the same extracted data as shown below. May I know what could be the root cause for this error ? Thank you.

 

image.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,043)