cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
bondy_07
Level: Powered On

Using apply to each - create HTML table and send one email

I have been trying to create a flow which will allow me to notify users when a task date is due and to have all due task in a single email because they do not want to receive an email for every single due item on the list.

I have the vast majority of the flow working fine but I can't seem to get around the "apply to each" step. I only want a single HTML table and email to be sent out with a list of all records, but I seem to only be able to have multiple emails sent out (as the "send an email" step repeats on the "apply to each" step).

I have attached a picture of the flow. Is it possible to have a "create HTML table" and "send an email" step? I don't want multiple emails, just 1 with a list of records on.

If I move the "send an email" step outside of the "apply to each" my condition no longer applies so I just get a list of all (unfiltered) records.

htmld.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Using apply to each - create HTML table and send one email

 

Hi @bondy_07 ,

 

You could use array variables to store the data in the HTML table, and then use the variable as the data source that creates the Table.

Please refer to the image below to configure Flow.

101.PNG

Details of Apply to each:

102.PNG

Hope it helps.

 

Best Regards,

Community Support Team _ Barry
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

9 REPLIES 9
Dual Super User
Dual Super User

Re: Using apply to each - create HTML table and send one email

Hi @bondy_07 

 

Rather than looping through items and then creating html table and sending emails

 

Use filter data operation and defined the same condition - this will return array of records matching the filter collection

Capture.PNG

Then you can create html table and send the email

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Community Support Team
Community Support Team

Re: Using apply to each - create HTML table and send one email

 

Hi @bondy_07 ,

 

You could use array variables to store the data in the HTML table, and then use the variable as the data source that creates the Table.

Please refer to the image below to configure Flow.

101.PNG

Details of Apply to each:

102.PNG

Hope it helps.

 

Best Regards,

Community Support Team _ Barry
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

bondy_07
Level: Powered On

Re: Using apply to each - create HTML table and send one email

Hi @v-bacao-msft ,

 

Thank you for the reply.

When I create HTML with HtmlTable variable array, it show me this error:

The property 'columns' must be specified unless the 'from' property value is an array of objects.

Community Support Team
Community Support Team

Re: Using apply to each - create HTML table and send one email

 

Hi @bondy_07 ,

 

Could you provide screen shoot of Flow configuration?

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
bondy_07
Level: Powered On

Re: Using apply to each - create HTML table and send one email

Hi,

 

@v-bacao-msft 

This is for apply to each:

apply to each.png

 

and this is for create HTML:

hmtl.png 

Community Support Team
Community Support Team

Re: Using apply to each - create HTML table and send one email

 

Hi @bondy_07 ,

 

Please follow the format in the screenshot provided by me to configure the Value, which needs to be a JSON object.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
bondy_07
Level: Powered On

Re: Using apply to each - create HTML table and send one email

Hi,

 

@v-bacao-msft 

Great! Thank you, now it works.

 

bondy_07
Level: Powered On

Re: Using apply to each - create HTML table and send one email

Hi,

 

@v-bacao-msft 

 

Thank you!

Bapt_69
Level: Powered On

Re: Using apply to each - create HTML table and send one email

Sorry,

I made this flow with "each for" providers and create a table with the orders (for each providers) :

 

screen1.png

 

Apply2 details :

screen2.png

 

The problem is : the initialisation is not setting. So, the HTMLTable become bigger and bigger...

How can I intialise my variable for each provider?

Helpful resources

Announcements
firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (4,948)