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
Solved! Go to Solution.
Oh! an easier alternative is before you process your source file which varies in filename, maybe you can just take that source file, copy-overwrite it into a "staging file", which will have a static filename. That way, while you are creating the flow, all the columns are available and you don't have to use expressions heavily.
Let me try...
4.1 Add a row in the table (to your master file)
Note when assigning values to each column in "Add Row To Table", use the expression:
items('Apply_to_each')?['put_your_column_name_here']
Thank you, it’s is possible to produce a screen shot of how this flow would look?
Note that "Table1" is entered as custom value in the first 2 steps
Thank you again.
Please fogive me as im a bit of a newbie... but i would like this triggered by the new excel file being created in the one drive folder. Do i just add this trigger to the start or are there other steps that would be needed to be added as well....
TIA
Oh! an easier alternative is before you process your source file which varies in filename, maybe you can just take that source file, copy-overwrite it into a "staging file", which will have a static filename. That way, while you are creating the flow, all the columns are available and you don't have to use expressions heavily.
Brillant! Thank you!
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! 😉
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
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
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