Showing results for 
Search instead for 
Did you mean: 
Resolver I
Resolver I

Dynamic table row count to eliminate blank rows in HTML email

l followed this guide to create an HTML template email:


This email is triggered automatically upon adding an item to a SharePoint list. The email includes a table which includes data from the SP list item. The challenge I'm facing now is if it is possible to make the table length change dynamically, since in some cases there are empty rows. Within each item, there may be anywhere from 1-25 rows and this should adjust dynamically. Is it possible to truncate the table length?

Example. Instead of an email like this:




I'd like the flow to dynamically eliminate excess rows to show an email like this:




Super User
Super User


You say that an email is triggered upon a new item added to your list which likely means you using a Flow. You’ll need to show us details of that Flow because that’s where you’ll need to adjust this

Community Support
Community Support

Hi @RodM ,


You could consider using filter+forall to generate dynamic HTML text.

For example:


  "<tr><td>"  & 
  Column1     &  
  "<tr><td>"  & 
  Column2     &
  "<tr><td>"  & 
  Column3     &



Best Regards,



The variable invoked is used to turn a multi-person Person column into a string for emailing.


Would you need to see the HTML code I'm sending for the email

Can you provide a sample data structure so that I can understand this better?


If you are collecting your table data inside the Flow then you can use an Array. What I do is


1. Create a blank Array Variable

2. Then inside an Apply to Each use Append to Array step. This is written in JSON

3. Then, once the Apply to Each is done parse that finished Array to a Create HTML Table step. Flow then builds the table for you


If the data is getting generated in PowerApps then parse to Flow something like what @v-bofeng-msft has suggested will work for you.

Helpful resources

Top Solution Authors
Top Kudoed Authors
Users online (4,202)