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 / Cannot extract HTML Ta...
Power Automate
Unanswered

Cannot extract HTML Table heading to Excel

(0) ShareShare
ReportReport
Posted on by 22

Hi, I am trying to extract an entire table from a website to excel. The extraction works however the table heading (<th>) doesn't appear in excel. It is only the table data cell (<td>)  that is extracted into excel.

 

Could anyone help give ideas on how to extract the table heading as part of the table data cell into excel?

I have attached screencaps of the excel output as well as the live web helper.

 

Thanks in advance.

@MichaelAnnis  @VJR @Highboy

Dummy Data: Live web helperDummy Data: Live web helperDummy data: Excel outputDummy data: Excel output

I have the same question (0)
  • Henrik_M Profile Picture
    2,021 Super User 2024 Season 1 on at

    Looks like something fishy is going on. Addison is listed twice. Is it a public website that you can share?

  • VJR Profile Picture
    7,635 on at

    Hi @Henrik_M, in case @philkam  comes up with it as a private website you can offer a suggestion you may have by trying the same on this public website - html table 

     

    I tried to spy the html table shown on the RHS of the above link and it shows the same problem as reported by @philkam. The html table UI element can be added but the column names do not write up to Excel in a direct way.

     

    Also an alternative solution could be of capturing html table to datatable and then to Excel, but looks like PAD does not have an option to write a datatable to Excel along with the column headers.

     

    Either modifying the css selectors or looping could be a suitable option.

  • philkam Profile Picture
    22 on at

    Hi @Henrik_M, about Addison being listed twice. It was an error on my path. I copied and pasted the range of cells from A1 to A2, that's why it is repeating. It should not have been so. I took a wrong screen capture.  In my solution which I find very tedious. I copied and pasted the range of cells to A2 and inserted the column names from A1 to F1.  I am looking for a better way to do that.

     

    Hi @VJR, how best do I modify the CSS selectors?

  • sjenkinsdc Profile Picture
    10 on at

    I am also having this issue.  I can see the column header names when I inspect the variable when I pause my desktop flow, but when I write the variable to excel, it doesn't include the column headers.  I definitely need the headers!  Anyone have a workaround?

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    Have you tried an Excel web query?

  • sjenkinsdc Profile Picture
    10 on at

    @MichaelAnnis Outside of PowerAutomate Desktop?  I'm using RPA because there are quite a few clicks to get to the data.

     

  • sjenkinsdc Profile Picture
    10 on at

    I figured it out in my case.  I had to do a separate loop through the '.columns' array on the 'DataFromWebPage' variable, where 'DataFromWebPage' is the html table I captured.  Here is a screenshot of how I structured my loop to write the columns into excel:

    sjenkinsdc_0-1644536390237.png

     

     

  • sjenkinsdc Profile Picture
    10 on at

    Figured it out and responded to OP.

    sjenkinsdc_1-1644536053829.png

     

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    I don’t know much about it, but as I understand it, if you have the web address you can use Excel Web Query to grab any data table that is showing on the web page and it’s supposed to be very simple to set up and very accurate. If it’s set up right, PAD should simply have to refresh the query when running. 

  • NikosMoutzou Profile Picture
    Microsoft Employee on at

    Hello to all.

     

    The February release of Power Automate for desktop, which is expected in the next two weeks, includes an improvement for extracting the headers of a HTML table. When the user will desire to include the headers into an Excel, then he/she should follow the below approach (NOTE: You will be able to apply this after the February release of Power Automate for desktop):

    NikosMoutzou_0-1644589494346.png

     

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