Showing results for 
Search instead for 
Did you mean: 
New Member

Iterating over array and sending mail with html table when array element condition is met

I have a Kusto query which retrives data in one single row for - error codes along with their respective error count. Using Flow i am able to populate an array and added the 'interesting' error codes with some user friendly text appended.


How can i iterate over the array and create a html table so that the user friendly text values is in the first column and the error count is in the 2nd column and send it in the email body? Also if possible i'd like to add headings for the html table columns.

Memorable Member
Memorable Member

Hello @faisalsns ,


There is a nice action for this to transform array into html table:



And for this action under advanced opitons there is possible to put custom headers to your table and pick columns you want:


I also suggest to use css styling if you want to send it via email. You can be inspired for example here


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

In your screenshot are "Distrikt" and "Storesstring" variables? For me these are calculated dynamically by splitting the error code from the array. The limitation am facing is i need to use a iteration to create the html table i.e. with 2 columns as described earlier but the output of the html table is not visible outside the "Apply to each" block. 

Helpful resources

UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (2,382)