Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

Creating HTML table with merged rows if they have common values

(0) ShareShare
ReportReport
Posted on by

Is is it possible to run a flow to create html tables that have merged rows if consecutive rows have the same value?

 

alicey_0-1695930658161.png

 

I've successfully created a html table with conditional formatting using the flow below. 

 

alicey_0-1695929681702.png

 

Details of the above flow:

alicey_1-1695930740062.png

 

alicey_3-1695930805217.png

 

  • Michael E. Gernaey Profile Picture
    44,695 Super User 2025 Season 1 on at
    Re: Creating HTML table with merged rows if they have common values

    Hi,

     

    Big Question: If the lists do NOT have any duplicates, do you want to still merge them and create an HTML Table? My example will send emails regardless of if the Merge did or did NOT have duplicates.

     

    You want to merge lists sets of data together, removing the duplicates and then you want to create an HTML table with the result?

    • But you only want this done IF they have matching rows? 
    • So you want it to figure out IF they have duplicates and if so merge them and make a table?

     

    My Assumptions here are that you will add another Get Items to get the other list (as i only see one) in your flow.

    I am also going to assume, that if the two lists have NO duplicates, that you still want to merge and create a table.

     

    Example: How you get rid of the duplicates:

    • I have created 2 arrays in variables. These arrays are identical to the Array output you would get from the Get Items, so it will work the same for you. Please make sure to LIMIT the columns you are choose. Add a View that has the minimal columns so as not to merge too much

      Here you can see in my arrays, that there is overlap in both. 2 duplicates to be exact. Betties Computer and Steves Table

    FLMike_0-1695965305247.png

     

     

    And then I have my Compose, which does a Union using both variables (AKA Arrays, Array1 & Array2)

     

    union(variables('Array1'),variables('Array2'))

     

    FLMike_1-1695965499441.png

    When it runs you can see I have no duplicates

     

    [
     {
     "user": "Betty",
     "deviceid": "AC-219",
     "device": "Computer"
     },
     {
     "user": "Betty",
     "deviceid": "AC-210",
     "device": "phone"
     },
     {
     "user": "Steve",
     "deviceid": "AC-219",
     "device": "Tablet"
     },
     {
     "user": "Dave",
     "deviceid": "AC-210",
     "device": "phone"
     }
    ]

     

     

    So for you after you run both Get Items, you would use union to merge them and remove the duplicates. The Arrays for YOU are the Dynamic property "value" from each Get Items. Assuming you didn't rename the action, you would have Get items and Get items 2

     

    So you would type

     

    union(insert dynamic property value from Get items, insert dynamic property value from Get Items 2)

     

     

    Now to create the Table which is much easier steps

    -After the Compose for the Union

    -Add a Create HTML Table

    -In the From set it to outputs('Name of Your Compose') 

    -which is the name of my Compose that did the union.

    -The result will be NO duplicates and a nice table

    FLMike_2-1695966281631.pngFLMike_3-1695966306108.png

     

    here is my entire flow

     

    FLMike_4-1695966359049.png

     

    Cheers
    If you like my answer, please Mark it as Resolved, and give it a thumbs up, so it can help others
    Thank You
    Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey

     

     

     

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1