cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

One drive "create file" replaces old file in the source folder

Hi,

I am have created a Flow, which uses "Create CSV Table" and then store the output as a file in a One Drive folder using One Drive "Create File".

The data is coming from a SharePoint list. The Flow triggers when a new item is created.
Problem:

Each time the flow runs it replaces the old file in the source folder.

Issue.jpg

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Super User III
Super User III

Re: One drive "create file" replaces old file in the source folder

@Soumodip 

To preserve the original file, consider adding something like the current date and time after the EmployeeName name in the action.  You'll enter utcNow() in the expression window.  It should look something like this:

Filename.png

 

Be sure to click on Update after entering utcNow() in the expression window.

Another alternative is just to let the file be overwritten.  Versioning is turned on by default in OneDrive for Business.  Creating the new file with the same name should just add a version to the existing file (double check me on this...)

 

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

View solution in original post

Highlighted
Helper I
Helper I

Re: One drive "create file" replaces old file in the source folder

Sorry!
I had made a silly mistake. I was getting the file name from after "Get item", which was returning the same name.

I fetched the name from "When an item is created" and that solved the problem!

View solution in original post

3 REPLIES 3
Highlighted
Super User III
Super User III

Re: One drive "create file" replaces old file in the source folder

@Soumodip 

To preserve the original file, consider adding something like the current date and time after the EmployeeName name in the action.  You'll enter utcNow() in the expression window.  It should look something like this:

Filename.png

 

Be sure to click on Update after entering utcNow() in the expression window.

Another alternative is just to let the file be overwritten.  Versioning is turned on by default in OneDrive for Business.  Creating the new file with the same name should just add a version to the existing file (double check me on this...)

 

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

View solution in original post

Highlighted
Helper I
Helper I

Re: One drive "create file" replaces old file in the source folder

Sorry!
I had made a silly mistake. I was getting the file name from after "Get item", which was returning the same name.

I fetched the name from "When an item is created" and that solved the problem!

View solution in original post

Highlighted
Helper I
Helper I

Re: One drive "create file" replaces old file in the source folder

Hi @ScottShearer,

This works too! Thanks.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors
Users online (4,398)