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

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
Highlighted
Community Support
Community Support

 

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
Highlighted
Dual Super User II
Dual Super User II

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

Highlighted
Community Support
Community Support

 

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

Highlighted

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.

Highlighted

 

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.
Highlighted

Hi,

 

@v-bacao-msft 

This is for apply to each:

apply to each.png

 

and this is for create HTML:

hmtl.png 

Highlighted

 

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.
Highlighted

Hi,

 

@v-bacao-msft 

Great! Thank you, now it works.

 

Highlighted

Hi,

 

@v-bacao-msft 

 

Thank you!

Highlighted

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Users online (9,095)