cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
bondy_07
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
v-bacao-msft
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
RezaDorrani
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

v-bacao-msft
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

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.

 

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.

Hi,

 

@v-bacao-msft 

This is for apply to each:

apply to each.png

 

and this is for create HTML:

hmtl.png 

 

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.

Hi,

 

@v-bacao-msft 

Great! Thank you, now it works.

 

Hi,

 

@v-bacao-msft 

 

Thank you!

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
MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Users online (52,889)