Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Copying rows from newly created Excel File to Master File

(0) ShareShare
ReportReport
Posted on by 60

Hi

 

Im trying to find a way to take the rows created in a new excel file and copy them across to a master excel file. Files can be stored in Sharepoint or one drive.

 

If i name the source file the this works. But the source files will have dynamic name and obviously dont exist yet, so i cant add the column names to the flow.

 

Any ideas how to achieve this?

 

Phil

  • tomier1991 Profile Picture
    4 on at
    Re: Copying rows from newly created Excel File to Master File

    I now tried to remove the reg expressions for the individual columns - now I get an error with the array function which I am unable to resolve.

  • tomier1991 Profile Picture
    4 on at
    Re: Copying rows from newly created Excel File to Master File

    Hi guys,

     

    I am trying to rebuild your flow but I am keep getting a error at the last step:

     

    "Flow save failed with code 'InvalidTemplate' and message 'The template validation failed: 'The repetition action(s) 'Apply_to_each' referenced by 'inputs' in action 'Add_a_row_into_a_table_2' are not defined in the template.'.'."

     

    See attached the screen - does somebody have any idea what I did wrong?

     

    Best

    Tomier

     

  • chrissahagun Profile Picture
    197 on at
    Re: Copying rows from newly created Excel File to Master File
    Nice. Didn’t know we could do that. Now I do. Thanks!
  • Bigshow Profile Picture
    60 on at
    Re: Copying rows from newly created Excel File to Master File

    Rather than a delay step I changed the settings of the copy step. I put in a retry count of 5 with a 5 minute interval. This seems to work ok

  • chrissahagun Profile Picture
    197 on at
    Re: Copying rows from newly created Excel File to Master File
    There’s a Delay step... you can have the flow wait for a few seconds before proceeding to the next step
  • Bigshow Profile Picture
    60 on at
    Re: Copying rows from newly created Excel File to Master File

    I have this working using your “staging file” idea. One thing I had to do is point the “listing rows” step to the staging file, then this would allow me to add the columns in the “add row” step. Once that’s done I went back to the list rows step and replaced the file name with the “file locator” dynamic 


    This works fine now, apart from if flow is run again to quickly, it errors out with a file lock

     

  • chrissahagun Profile Picture
    197 on at
    Re: Copying rows from newly created Excel File to Master File
    i havent tried renaming files yet. But if that error is on the step itself on the flow IDE, maybe be sure to choose “enter custom value” first? Or if it errors on runtime, maybe the file path format is incorrect. Check the run logs for the input and output values. Also it might be better to COPY over the staging file, not rename. This is so that you can still preserve your source file.
  • Bigshow Profile Picture
    60 on at
    Re: Copying rows from newly created Excel File to Master File

    Just a quick question. How do i rename the file? in the desitnation file path i put the dynamic filepath/stagingfile.xlsx but it errors out with the path\orginalfile.xlsx/stagingfile.xlsx

     

     

  • chrissahagun Profile Picture
    197 on at
    Re: Copying rows from newly created Excel File to Master File

    Am glad you're happy!  I'd be too if you mark my response! 😉

     

    As for your trigger question, yes i think it's pretty much straightforward.  but if you are doing the "staging file" alternative, you should add a condition right after the trigger.  so that if the detected "file created" is just the overwritten "staging file", the flow must Terminate (this is a step) - to avoid infinite loops due to this flow triggered by a file create, but it also creates a file. 😄

     

    P.S. I too am still learning Flow.  I was just told that one way of learning would be participating in communities like this and trying to solve other people's problems.  That way, I get exposed to real scenarios.  Maybe this works for you too! 😉

  • Bigshow Profile Picture
    60 on at
    Re: Copying rows from newly created Excel File to Master File

    Brillant! Thank you!

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 566 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 516 Super User 2025 Season 1

#3
stampcoin Profile Picture

stampcoin 492