Hello,
I have a flow where I I am looping every country to filter array from 2 share point list and creating 2 HTML tables out of it to send it an email. (Flow can be seen below ) .
But I want to merge the 2 HTML table output into one consolidated HTML before using it in Email step. I do not want to send 2 different tables inside a email . Both these HTML table output are having same columns , only difference is the Data.(Example can be seen below ) .
Ideally, I would like to avoid nested loop(Apply to each inside current Apply to each ) if possible.
Can you let me know of any way I can achieve this ?
Thank you
Current flow:
HTML table output example:
Hi to the solution giver
I use your solution,, but my table does not have any grids. can you optimize your code? ^_^
Thank you @v-dezhili-msft , It did the job for me. Appreciate it.
Hi @Sivaperumal31 ,
If your two tables have the same format, you can hand-write an HTML table header, and then use the split() formula to cut out the table body and merge them together.
<table>
<thead>
<tr>
<th>Name</th>
<th>Grade</th>
<th>Date</th>
</tr>
</thead>
<tbody>
@{split(split(body('Create_HTML_table'),'<tbody>')[1],'</tbody>')[0]}
@{split(split(body('Create_HTML_table_2'),'<tbody>')[1],'</tbody>')[0]}
</tbody>
</table>
Best Regards,
Dezhi