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 / Excel API Unexpected B...
Power Automate
Suggested Answer

Excel API Unexpected Behaviours

(0) ShareShare
ReportReport
Posted on by
i have a flow that makes use of the excel and sql API, in a few parralel branches, im trying to delete everything form an excel spreadhseet with 4,5 tables. i list rows present in a table, then loop over that output, in that loop delete every row using a unique identifier (it is unique and trimmed) and then its just randomyl failing on random lines, saying item not found, then when i get the number that it says it couldnt find in the delete action, i search for it in the list rows action, and its there!! it makes no sense, any ideas? thanks
I have the same question (0)
  • Suggested answer
    chiaraalina Profile Picture
    2,425 Super User 2026 Season 1 on at
     
    As soon as you hit the same workbook from parallel branches, or from an Apply to each that runs fast, the session and the row indexes get out of sync, and you start seeing itemNotFound on rows that are clearly still in your previous List rows present in a table output.
     
    The output of List rows present in a table is basically a snapshot taken at one moment. Microsoft mentions under the known issues that the data may not be fully up to date, especially when filtering or sorting is involved. The moment your first delete goes through, every other row shifts, but your loop is still iterating over the old snapshot, so the lookup eventually points at something that no longer matches. So it is not a bug.
    On top of that, the connector explicitly does not support simultaneous modifications on the same workbook. And, 
    the Excel Online (Business) connector is throttled at around 100 calls per 60 seconds.
    Instead of looping and calling Delete a row once per row, the much more reliable approach is to run an Office Script through the Run script action. The script executes server side in a single Graph call, so you skip the session drift, the throttling and the case sensitivity issues at once.

    Something like:
    function main(workbook: ExcelScript.Workbook) {
      const tableNames = ["Table1", "Table2", "Table3", "Table4", "Table5"];
     
      for (const name of tableNames) {
        const table = workbook.getTable(name);
        if (table && table.getRowCount() > 0) {
          table
            .getRangeBetweenHeaderAndTotal()
            .delete(ExcelScript.DeleteShiftDirection.up);
        }
      }
    }
     
    In Power Automate you then just add one Excel Online (Business) → Run script action and point it at your workbook. That single action replaces the whole List rows present in a table plus Apply to each plus Delete a row pattern.

     

    If Office Scripts are not available in your tenant or you don't want to use it

    The next best option is to call the Microsoft Graph Excel API directly through an HTTP action. The connector is built on that API anyway, and calling it directly lets you clear a whole range in one request instead of one request per row, which keeps you well inside the Graph throttling limits.

    Hope it helps!

  • Suggested answer
    11manish Profile Picture
    3,333 on at
    The most likely cause is concurrency and Excel table locking/index changes during deletion. Excel is not designed to handle multiple parallel delete operations
     
    against the same workbook.
     
    Try disabling concurrency, processing tables sequentially, or replacing row-by-row deletes with an Office Script that clears entire tables in a single operation.
     
    If the problem disappears when concurrency is reduced to 1, you've almost certainly identified the root cause.

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 377

#2
11manish Profile Picture

11manish 279

#3
David_MA Profile Picture

David_MA 234 Super User 2026 Season 1

Last 30 days Overall leaderboard