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 / For Each loop not extr...
Power Automate
Answered

For Each loop not extracting all fields from table

(0) ShareShare
ReportReport
Posted on by 124

Im extracting data from a table on a website CNMV - Takeover bids  and when I use the Extract data from web page tool it seems to work:

Craigja_0-1689590393468.png

Next I want to paste the data in column 1 and 3 into Excel - so I use a For Each loop, configured as below, to iterate over the datatable and store it into SpainItem

 

Craigja_2-1689590487254.png

What is strange though, is that it brings through the 3 columns in the table, but it doesn't populate the third column with data - what am I doing wrong?

 

Craigja_1-1689590469919.png

 

  • Steve48 Profile Picture
    431 on at

    What action are you using to write to Excel? Write to Excel Worksheet? How is it configured?

  • Craigja Profile Picture
    124 on at

    Its not getting that far - my question is why when I use the for each loop, does it then not populate column 3? it only populates the first 2 columns

  • Verified answer
    Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    This is actually quite strange, to be honest. I have never seen this happen. But have you tried to actually write a value to Excel to see if this is simply a bug in the variable preview, or an actual issue with the values? It might be that it would in fact write properly, and is simply bugged when it comes to previewing the variable in PAD.

     

    Alternatively, try using a simple Loop from 0 to %DataFromWebPageSpain2.RowsCount-1% and store the index into %LoopIndex%. You can then retrieve your values as %DataFromWebPageSpain2[LoopIndex][0]% for column 1 and %DataFromWebPageSpain2[LoopIndex][3]% for column 3.

     

    A second alternative would also be using the Retrieve data table column into list action to retrieve columns 0 and 2 into lists. You could then write the entire list into Excel right away, without the need of using loops and writing one value at a time. The Write to Excel worksheet action interprets lists properly and passes them to as many rows as there are list items.

    -------------------------------------------------------------------------
    If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.

    I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.

  • Craigja Profile Picture
    124 on at

    So although it wouldnt show me, when I wrote the value in column 3 to the spreadsheet it did work, so must be some strange bug

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 377

#2
11manish Profile Picture

11manish 302 Super User 2026 Season 2

#3
Henil Profile Picture

Henil 130

Last 30 days Overall leaderboard