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 / List rows present in a...
Power Automate
Answered

List rows present in a table - dynamic Excel file

(0) ShareShare
ReportReport
Posted on by 32

Hello all!

There is a problem when trying to iterate over a dynamic chosen Excel file.

 

The flow runs once a week.

The scenario is that there is a folder A which all it's files will be deleted first.

After that, an specific Excel file "test.xlsx" will be copied into this folder.

Then, the Excel file will be read in the form of created batches of 5000 rows each.

 

The idea of resizing the large Excel file into smaller chuncks is originally related to this post:

Re: When an Excel row is created, modified, or del... - Power Platform Community (microsoft.com)^

 

My flow acts on a scheduled automation. The original post is related to "When an item or file is modified".

 

Flow build:

file0.png

 

Flow logic:

file3.png

 

Length function:

length(outputs('List_rows_to_get_count_-_Temp')?['body/value'])

 

 

 

 

 

 

 

 

 

Mul function:

mul(15000, iterationIndexes('Do_until_Get_row_count_for_batches'))

 

 

 

 

 

 

 

 

Range function:

range(0, div(actions('List_rows_to_get_count_-_Temp')['inputs']['parameters']['$skip'], 5000))

 

 

 

 

 

 

Mul function:

mul(5000, items('Apply_to_each_Get_all_rows_in_batches'))

 

 

 

 

As you see, the idea is to portion the large Excel file into batches of 5000 rows each.

 

Error:

The cause of the error message is that the "item was not found" for the first batch.

The other two batches work fine!.

file4.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

The flow works perfectly fine for a static file.

I tried a lot of different approaches but can not figure out what the cause of the failed first item for the dynamic chosen file is.

 

Many thanks!

 

Best regards, 

VDG

Categories:
I have the same question (0)
  • lbendlin Profile Picture
    8,715 Super User 2026 Season 1 on at

    Can you confirm that you have the same table name defined in all the Excel files?

  • VDG Profile Picture
    32 on at

    Yes, the table names are exact the same.

     

    The flow even worked twice.

  • VDG Profile Picture
    32 on at

    So, what do you think?

  • lbendlin Profile Picture
    8,715 Super User 2026 Season 1 on at

    We have a thread on the Power BI Forum that sounds eerily similar. Could be caused by a recent service change.

  • VDG Profile Picture
    32 on at

    Hi @lbendlin

    thanks for your feedback.

     

    Could you please provide me a link to that thread? 

    Best regards, 

    VDG

  • Verified answer
    VDG Profile Picture
    32 on at

    SOLUTION!

     

    Hi all,

    It is well known that Power Automate has some issues when trying to access the same file more than once.

    My first approach was to add a delay of 7 minutes between the Do untol and Apply to each. It did not work.

    Quiet strange because the delay of 6 to 7 minutes should be enough.

     

    In this case the delay equals 15 min!

    solution.png

     

    I hope that solution works for everybody with the same problem.

     

    Best regards, 

    VDG

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 784

#2
Valantis Profile Picture

Valantis 589

#3
Haque Profile Picture

Haque 522

Last 30 days Overall leaderboard