cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
faisalsns
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.

2 REPLIES 2
Highlighted
Super User
Super User

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

Hello @faisalsns ,

 

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

Flow_HTML.jpg

 

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

Flow_HTML2.jpg

I also suggest to use css styling if you want to send it via email. You can be inspired for example here https://www.w3schools.com/css/tryit.asp?filename=trycss_table_fancy

 

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

faisalsns
New Member

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

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

Announcements
firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

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!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Users online (7,587)