web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id : vmxx238gzEtnPeUuI/xzAG
Power Automate - Building Flows
Answered

Copying rows from newly created Excel File to Master File

Like (0) ShareShare
ReportReport
Posted on 19 Mar 2021 14:47:21 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

I have the same question (0)
  • tomier1991 Profile Picture
    4 on 24 Jul 2023 at 03:37:25
    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 24 Jul 2023 at 03:21:10
    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 20 Mar 2021 at 17:06:17
    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 20 Mar 2021 at 16:46:50
    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 20 Mar 2021 at 15:28:00
    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 20 Mar 2021 at 13:54:30
    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 19 Mar 2021 at 17:15:05
    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 19 Mar 2021 at 16:54:53
    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 19 Mar 2021 at 16:36:34
    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 19 Mar 2021 at 16:30:47
    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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 986 Moderator

#2
stampcoin Profile Picture

stampcoin 699 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 577 Super User 2025 Season 2