Let's POWER Automate

From no-code to low-code

Menu
  • Expressions
  • Filters
  • General
  • Application specific solutions
    • Dataverse
    • Excel
    • Forms
    • Outlook
    • Planner
    • Power Apps
    • SharePoint
    • Teams
  • Triggers
  • Ready to use solutions
    • Approval Process Template
    • Task Delegation App
    • The Ultimate Power Automate expressions cheat sheet
    • Power Automate HTTP requests to SharePoint cheat sheet
    • Power Automate HTTP requests to Graph API cheat sheet
  • ABOUT ME
  • Get help with your flow
  • POWER PLATFORM SERVICES
Menu

Update multiple Excel rows with the same key in Power Automate

Posted on September 4, 2022April 2, 2023 by Tom

“I’m trying to update multiple rows in an Excel file with Power Automate, but it keeps overwriting the data on the first row!”


Using Power Automate to update rows in an Excel file has a small downside – there’s no unique id to identify the rows. Unlike in SharePoint, where you select the row id, in Excel you use the Key Column and Key Value combination. A column the flow should search in, and the value it should search for. The first row containing the value is the one that the flow will update.

Which can be a problem if the table contains duplicate values. The flow will never move to the 2nd or 3rd row, it’ll keep updating the first one from the top.

Power Automate Excel update multiple rows

Unless you use a small workaround.

Add a new column to the Excel file

To update a specific row you’ll always need the column – value combination. The only way to move to the next row would be to modify the value in the currently processed row, and let the flow find the next one. But it’s not always possible to change the value as you need the information. For this reason you’ll need another column with the same information, whose modification won’t matter.

Once you have this column you can use it in the ‘Update a row’ action. Find the row with the value, update the other columns, and change the value. Just keep in mind that the value must be unique, e.g. a date and time.

Once the value is updated, the flow will automatically select the next row for the next update.

Summary

When building a flow, you should always consider not only the flow itself, but also the data it works with. If Power Automate doesn’t allow you to update multiple Excel rows with the same value, you can just add another column as a workaround. It’ll find the row with the value duplicate, update it, and change the value. That way it’ll never find the same row, always updating the next one.

But you can make your life much easier if you add a unique id to each row.


πŸš€ Master Power Automate

Join 2,000+ professionals getting actionable Power Automate tutorials, solutions, cheat sheets & tips every week.

No spam. Unsubscribe anytime.

6 thoughts on “Update multiple Excel rows with the same key in Power Automate”

  1. Felipe Gil says:
    January 19, 2023 at 6:23 pm

    Hii have a question.

    I am finding the way to update multiple excel rows that have the same id; because as you show on the solution of this question:

    https://tomriha.com/update-multiple-excel-rows-with-the-same-key-in-power-automate/#:~:text=If%20Power%20Automate%20doesn%E2%80%99t%20allow%20you%20to%20update,the%20same%20row%2C%20always%20updating%20the%20next%20one.

    The function only update the first row with the key id; but in my program i want to update all the rows that have that key id.

    Thank you for your blog it is very helpful and if you can help me with this question; it would be awesome.

    Reply
    1. Tom says:
      January 26, 2023 at 3:10 pm

      Hello Felipe,
      that’s why you need an extra column whose value you can change and base the flow on this new column – once you change the key value it’ll pick the next row and update it. It’s not possible to do it if you have only 1 column.

      Reply
  2. J says:
    February 27, 2024 at 11:36 am

    Hello Tom, I’m really struggling with this I’ve found no other help online for this scenario.
    What you are saying here makes sense but your example key value is static, how might this be made dynamic ?
    For example if you had a filter array to get all of the duplicated occurrences and wanted to update all of those?

    Reply
    1. LK says:
      March 7, 2024 at 4:02 am

      The answer is here, but its not obvious at first. The point is, this Action always going to update the first item it finds with the key – so as the loop is running, you update the key value you just used to something else unique like the date and time, and then on the next iteration of the loop, the next item with the same key becomes the ‘first’ item . You need to make a duplicate of your ‘key’ column to use for the flow, because it won’t matter if you trash the duplicate by changing its values as the loop is running. After you’ve finished, if you only need to run this flow one time, you can delete the second key column.

      Reply
    2. LK says:
      March 7, 2024 at 4:04 am

      If you want to take an array which is a subset of the rows in your spreadsheet and do something with that array, you probably need to write to a new sheet by a different method.

      Reply
    3. Tom says:
      March 17, 2024 at 1:21 pm

      Hello J,
      you can make the key value dynamic, it would be a similar approach as in this article: https://tomriha.com/send-users-single-email-with-multiple-excel-rows-power-automate/. Get all the unique values from that column, loop through all of them, and update the rows one after another – it would be a loop in a loop.

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

πŸš€ Master Power Automate

Join 2,000+ professionals getting actionable Power Automate tutorials, solutions, cheat sheets & tips every week.

No spam. Unsubscribe anytime.

Still exchanging emails to get things approved?

Use the Approval Process Template and the Task Delegation App to skip the hard part and deploy an automated, fully functional approval solution on a SharePoint list in minutes! And then the next one, and the next one...

Approval Template Preview ✨ Learn more ✨

Turn ideas into flows with ease!

Grab the complete Power Automate Cheat Sheet Bundleβ€”everything you need to master expressions, SharePoint HTTP calls, and Graph API in Power Automate.

Cheat Sheet Bundle Preview ✨ Get the Cheat Sheets

Didn't find what you were looking for?
Need to adjust a solution to fit your needs?
Or would you just like to get an assistance from somebody with thousands of hours of experience with Power Automate?

Power Automate blogs worth visiting

Damien Bird
Dennis (Expiscornovus)
Paul Murana

©2025 Let's POWER Automate | Theme by SuperbThemes