Let's POWER Automate

From no-code to low-code

Menu
  • Expressions
  • Filters
  • General
  • Application specific solutions
    • Dataverse
    • Excel
    • Forms
    • Outlook
    • Planner
    • Power Apps
    • SharePoint
    • Teams
  • Triggers
  • Ready to use solutions
    • Approval Process Template
    • Task Delegation App
    • The Ultimate Power Automate expressions cheat sheet
    • Power Automate HTTP requests to SharePoint cheat sheet
    • Power Automate HTTP requests to Graph API cheat sheet
  • ABOUT ME
  • Get help with your flow
  • POWER PLATFORM SERVICES
Menu

How to invert HTML table rows/columns in Power Automate

Posted on October 22, 2023October 22, 2023 by Tom

“Can I invert the HTML table created by Power Automate flow, to have header in the first column and data next to it?”


When you create an HTML table in Power Automate, it has always the same layout. The column names are at the top, in the first row, and all items on the following rows. It’s the standard layout everyone is used to e.g. from Excel tables. But what if you’re not happy about it? If you’d like to invert the table, to have the data in columns instead of rows? How would you do it in Power Automate?

Use ChatGPT to do it for you

Inverting an HTML table is not an easy task as there’re so many things to process. While it might be doable using some complex combination of split(…) and many other expressions, there’s one much easier approach. Instead of doing the inversion by yourself, you can use ChatGPT to do it for you!

In the previous post I explained how to access ChatGPT from a flow and how to use it to process Teams attendance report. This time you can use it to invert an html table.

Start by getting all the items for the table and create it with the ‘Create HTML table’ action.

Follow with a ‘Compose’ action where you explain the AI what you’d like to do, e.g.

Please invert the html table below. Move the header from the first row to the first column, turn all the data rows into columns and remove the header.

@{body('Create_HTML_table')}
Power Automate invert html table

And sent he request to ChatGPT as explained in the article dedicated to ChatGPT.

Power Automate invert html table

Extract the response with an expression…

body('HTTP')?['choices'][0]?['message']?['content']

…and send the inverted table in an email.

Power Automate invert html table

Summary

As you can see in this example, if you learn to use AI in your flows, you can do so much more with much less work.

A dedicated Power Automate flow that’d invert an HTML table would be very complex and would take a lot of time to build, not to mention the necessary skills and knowledge. On the other side, writing a request to ChatGPT doesn’t take very long and everyone can do it. That’s why you should add this approach to your toolkit. Even though it’s not a solution to every problem and has some additional costs, sometimes it’s worth it to delegate work to AI.


πŸš€ Master Power Automate

Join 2,000+ professionals getting actionable Power Automate tutorials, solutions, cheat sheets & tips every week.

No spam. Unsubscribe anytime.

1 thought on “How to invert HTML table rows/columns in Power Automate”

  1. Popkornak says:
    November 14, 2023 at 1:41 pm

    Why not use the AI to build you that transpose process via Powe Automate Co-pilot πŸ˜›
    As always, excellent article.

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

πŸš€ Master Power Automate

Join 2,000+ professionals getting actionable Power Automate tutorials, solutions, cheat sheets & tips every week.

No spam. Unsubscribe anytime.

Still exchanging emails to get things approved?

Use the Approval Process Template and the Task Delegation App to skip the hard part and deploy an automated, fully functional approval solution on a SharePoint list in minutes! And then the next one, and the next one...

Approval Template Preview ✨ Learn more ✨

Turn ideas into flows with ease!

Grab the complete Power Automate Cheat Sheet Bundleβ€”everything you need to master expressions, SharePoint HTTP calls, and Graph API in Power Automate.

Cheat Sheet Bundle Preview ✨ Get the Cheat Sheets

Didn't find what you were looking for?
Need to adjust a solution to fit your needs?
Or would you just like to get an assistance from somebody with thousands of hours of experience with Power Automate?

Power Automate blogs worth visiting

Damien Bird
Dennis (Expiscornovus)
Paul Murana

©2025 Let's POWER Automate | Theme by SuperbThemes