Skip to main content

Notifications

Community site session details

Community site session details

Session Id : 6sZmv0jBzp7YBTUqSzg/5C
Power Automate - Building Flows
Answered

Merging 2 or more HTML tables into one in flow

Like (0) ShareShare
ReportReport
Posted on 10 Mar 2023 01:38:51 by 75

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: 

Sivaperumal31_0-1678411963516.png

 

HTML table output example:

Sivaperumal31_2-1678412208412.png

 

 

 

  • Amirin Profile Picture
    128 on 14 Aug 2023 at 22:02:39
    Re: Merging 2 or more HTML tables into one in flow

    Hi to the solution giver

    I use your solution,, but my table does not have any grids. can you optimize your code? ^_^

    Amirin_1-1692050551621.png

     

  • Sivaperumal31 Profile Picture
    75 on 17 Mar 2023 at 04:14:54
    Re: Merging 2 or more HTML tables into one in flow

    Thank you @v-dezhili-msft , It did the job for me. Appreciate it.

  • Verified answer
    v-dezhili-msft Profile Picture
    Microsoft Employee on 10 Mar 2023 at 06:13:00
    Re: Merging 2 or more HTML tables into one in flow

    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.

    vdezhilimsft_1-1678428644050.png

     

    vdezhilimsft_0-1678428507615.png

    vdezhilimsft_2-1678428664545.png

    vdezhilimsft_3-1678428702079.png

    vdezhilimsft_4-1678428729045.png

    <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

     

     

     

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Thomas Rice – Community Spotlight

We are honored to recognize Thomas Rice as our March 2025 Community…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,508 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,369 Most Valuable Professional

Leaderboard
Loading started
Loading complete