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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Help needed please on ...
Power Automate
Answered

Help needed please on how to iterate through an HTML table and put that all in a data table using PAD?

(0) ShareShare
ReportReport
Posted on by

Hello Everyone.

 

I have a flow that looks like this:

 

PowerAutomateScreenshot.png

 

I capture an HTML table from a webpage and call it TopsOrderDataTable.

It has three columns, which I have created variables for for the current item for each.

I then filter out rows from the HTML table by order status and I want to put that data in to a data table called TopsNEWDataTable.

My questions are:

1 - I can get one row added successfully (line 143), but how can I iterate through the main HTML table data and add the rest of the rows to my data table?

2 - Is it possible to then count the number of rows in my data table and store that as a variable to use later?

Thank you very much for any help.

  • CU-19081228-9 Profile Picture
    on at

    @VJR Is this something you can help me with please?  I saw you have answered similar topics.

     

    Thank you!

  • Verified answer
    VJR Profile Picture
    7,635 on at

    1 - I can get one row added successfully (line 143), but how can I iterate through the main HTML table data and add the rest of the rows to my data table?

    What you are doing already seems to be correct. Ie; Looping through the main table and inserting row when the status is New. Check whether the loop is going fine.


    2 - Is it possible to then count the number of rows in my data table and store that as a variable to use later?

    %MyDatatable.RowsCount% will give the row count.

  • CU-19081228-9 Profile Picture
    on at

    Thank you for replying @VJR and letting me know how to get the row count - you're awesome!

     

    It seems I fixed it.  My HTML table pager element was not the right one, so I was not getting all the data.  I'll take a look again and get back to you if I have further questions.  Thanks!

  • CU-19081228-9 Profile Picture
    on at

    @VJR  I can't get something so simple to work, and it's driving me crazy.

     

    My loop simply won't iterate through the main HTML table data, meaning the data table only gets one row added, but nothing else - it all looks correct to me, but obviously I am missing something, can you possibly help please?

    So, for example, the HTML data (TOPSMCOMData) may have 9 rows of data, but the datatable (MCOMTOPSOH) will only have the first row.

    ianwuk_0-1674483359995.png


    Hope that makes sense?  Thanks!

  • VJR Profile Picture
    7,635 on at

    Hi @ianwuk 

     

    Step through the process one line at a time using F10.

    This will make it clear where it is coming out, or where it is not satisfying any condition.

  • CU-19081228-9 Profile Picture
    on at

    Thank you for replying @VJR 

     

    I'm having so much trouble doing this simple task (most likely the issue here is me!).

     

    1 - When extracting HTML table data, PAD won't get it all.  For example, the HTML table has 300 results, PAD only returns 100 (first page).

    I've set up pagination, I watch PAD 'click through' each table page (for example, four pages and 400 records), then it sits there and does nothing further after reaching the end page (so nothing is extracted and saved). 

    Not sure how long it is meant to take?  I've seen YouTube video with the same thing, and it wasn't like this for them.  So, I don't know how to fix that.

    Because of that I can't then do the next part to filter that datatable for what I want.

    I'm looping around more than the loop I am trying to create.

     

    Thanks so much for any help.

  • momlo Profile Picture
    1,527 Super User 2024 Season 1 on at

    Hi @ianwuk 

    This is very often situation caused by the page design.

    Web data extraction action assumes there is new page to be extracted whenever pagination (next button) element exist on the page. If it would be gone on the last page, PAD action would see that there is no "next" page so the extraction is complete.

     

    To workaround this, you need to capture the number of pages to the variable and then use it in erb extraction action to set up how many pages it should process.

     

    I have answered similar question on this forum recently so you can search.

  • CU-19081228-9 Profile Picture
    on at

    Thank you for replying @momlo .  If I set the extraction to not extract all pages, but to extract a certain number (say no more than 5), then would that serve as a workaround to make sure PAD has an ending page number to complete the extraction?

  • momlo Profile Picture
    1,527 Super User 2024 Season 1 on at

    Yes, it will try to extract max 5 pages and ignore the rest.

    Hence it is better to capture the number of pages first and then use this number in the extraction action, instead of using hardcoded value.

  • CU-19081228-9 Profile Picture
    on at

    @momlo If the number of pages is dynamic each time, meaning it may be 3 pages, 5 pages, 10 pages etc., would it still work if I set the maximum number of pages to, say, 10, even if it may be less than that?

     

    Thanks so much!

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 424

#2
11manish Profile Picture

11manish 328 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 274

Last 30 days Overall leaderboard