web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How can I add a row in...
Power Automate
Unanswered

How can I add a row in a html table

(0) ShareShare
ReportReport
Posted on by

Hello all,

 

I have a flow already that generates an HTML table. However, I am stuck in adding a row for the table. 

 

Hope can get some help.

 

 

 

Desirable HTML table

sam123123123_1-1707884182833.png

 

Excel table:

sam123123123_3-1707884494289.png

 

 

Current flow:

sam123123123_4-1707884564348.png

 

 

 

Categories:
I have the same question (0)
  • v-yueyun-msft Profile Picture
    on at

    Hi, @sam123123123 

    If you want to insert a row in "Create html table", then you need to merge the two arrays. You'll need to create your total row as an array yourself. Then merge the two arrays, and finally create the HTML table.

     

    Best Regards,

    Yueyun Zhang

  • sam123123123 Profile Picture
    on at

    Hello Yueyun Zhang,

     

    Nice to see you again. Is it possible that you do a small demo or provide a sample flow that I can use it for my flow. Really appreciate!

  • v-yueyun-msft Profile Picture
    on at

    Hi , @sam123123123 

    Thanks for your response! For example , this is an test array created by the "Initialize variable":

    [
     {
     "Document Date": "2023/02/12",
     "Due date": "2023/02/20",
     "Balance": 100,
     "0-30": 150,
     "31-60": 120
     },
     {
     "Document Date": "2023/02/13",
     "Due date": "2023/02/21",
     "Balance": 50,
     "0-30": 120,
     "31-60": 320
     },
     {
     "Document Date": "2023/02/14",
     "Due date": "2023/02/22",
     "Balance": 120,
     "0-30": 250,
     "31-60": 220
     }
     ]

    vyueyunmsft_0-1707987064800.png

    This is my test flow:

    vyueyunmsft_1-1707987262055.png

    xml(json(concat('{"root":{"item":',variables('DataTest') ,'}}')))

    xpath(outputs('Compose'), 'sum(/root/item/Balance)')

    xpath(outputs('Compose'), 'sum(/root/item/_x0030_-30)')

    xpath(outputs('Compose'), 'sum(/root/item/_x0033_1-60)')

     

    union(outputs('Compose_2'),variables('DataTest'))

     

    And you need to test it in your side and replace the action name and the field name in your side.

     

    Best Regards,

    Yueyun Zhang

     

     

  • sam123123123 Profile Picture
    on at

    Hello Yueyun Zhang,

     

    Thanks for the solution. It seems like your solution is summing up all the numbers, which I think it will be useful in the future, but I am stuck in designing the HTML table like the below picture. I am wondering how to insert a "Total" row in a HTML table. Thanks!

     

    sam123123123_1-1707988516513.png

     

  • v-yueyun-msft Profile Picture
    on at

    Hi , @sam123123123 

    In my understand , this is the total row.

    vyueyunmsft_0-1707988838178.png

    And if you want to update the html table , you can see the output of the "Create html table" action:

    vyueyunmsft_1-1707988877385.png

     

        "body""<table><thead><tr><th>Document Date</th><th>Due date</th><th>Balance</th><th>0-30</th><th>31-60</th></tr></thead><tbody><tr><td></td><td></td><td>270</td><td>520</td><td>660</td></tr><tr><td>2023/02/12</td><td>2023/02/20</td><td>100</td><td>150</td><td>120</td></tr><tr><td>2023/02/13</td><td>2023/02/21</td><td>50</td><td>120</td><td>320</td></tr><tr><td>2023/02/14</td><td>2023/02/22</td><td>120</td><td>250</td><td>220</td></tr></tbody></table>"
     
    If you want to update this html , you can refer to this html code and find where you need to add some rows.
    And you can test the html code in w3school.
     

    Best Regards,

    Yueyun Zhang

  • sam123123123 Profile Picture
    on at

    Hi Yueyun Zhang,

     

    I think I should say column. And then the table is a two-dimensional table instead of one. Sorry for the confusion.

     

  • Verified answer
    v-yueyun-msft Profile Picture
    on at

    Hi, @sam123123123 

    Thanks for your response! Do you mean you want to add a column in a html table. If this , you can union this array:

    vyueyunmsft_0-1708044787381.jpeg

     

    union(outputs('Compose_2'),variables('DataTest'))

     

    The result is as follows:

    vyueyunmsft_1-1708044787383.jpeg

     

    And in my understand, there is no method to create a two-dimension table using the "Create html table" action.

     

    Best Regards,

    Yueyun Zhang

     

     

  • sam123123123 Profile Picture
    on at

    OK, thanks for the solution!!

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard