Showing results for 
Search instead for 
Did you mean: 
Not applicable

Updating a file on OneDrive in the middle of running a flow?

Hello all,


I'm trying to automate a process at the university I work at but have run into an issue. I currently have attachments going to a OneDrive folder upon being sent to a apecific email. Then, once the attatchment is in the folder, it triggers an approval that, once approved, the file will be moved to another folder. However, I need the content of the file to be updated, while having the same name, before it is moved to the next folder.


In other words, the file is added to the first folder and the approval is triggered. Then, while the flow is waiting on the file to be approved I'll change the file, combining two PDF's but keeping the same name. I will then approve the file and it is sent to the next folder with the new content.


Any attempts I've made to create this type of flow ends up moving the old file into the new folder. I figured this had somthing to do with the flow holding on to the content through the entirety of the iteration so I tried forcing the file to update with the other flow connectors but still no sucess. 


I'm going to try breaking this up into multiple Flows and see if that helps at all but I'd rather keep it in one flow.

If anyone happends to have any ideas or have dealt with something like this before I'd really appreciate the assistance.


-Matthew Morrow-


Community Support
Community Support

Hi @Anonymous,


Could you please share a screenshot of your flow's configuration?

Could you please show more details about the error message?

Further, how do you change the original file on your side? Do you create a new file with same file same as original file within your OneDrive folder? Could you share more details about the following statement?

@Anonymous wrote:

Then, while the flow is waiting on the file to be approved I'll change the file, combining two PDF's but keeping the same name.



I have made a test on my side (the Excel file is added to my first folder and the approval is triggered) and the flow works well. My flow's configuration as below:

  • Add a "When a file is created (properties only)" trigger.
  • Add a "Start an approval" action, specify Assigned to value.
  • Add a Condition, left input box set to Response dynamic content of the "Start an approval" action, right input box set to Approve. Within middle drop down, choose is equal to.
  • Within "If/yes" branch of Condition, add a "Move or rename a file" action, File field set to Id dynamic content of the trigger, specify destination file path within Destination File Path field of "Move or rename a file" action.

Image reference:12.JPG

The flow works successfully as below:13.JPG


If you create a new file with same file name as original file within your OneDrive folder and then want to move it to another folder, I think it could not be achieved within your flow.


Actually, the "Move or rename a file" action use a unique file identifier (Id dynamic content) to find the original file, if you create a new file with same file name within your OneDrive folder, the unique file identifier would be changed.


Best regards,




Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Not applicable

Hi Kris,


So, I should have mentioned in my initial post that I've only recently started working with flows but thanks to the few programming classes I've taken in the past I can understand how they work from a logical perspective but I'm by no means an expert at it. Regardless of that, I would share one of my flows but at this point they are unorganized messes of experementation that likely shouldn't see the light of day.


So simply put, I can make and have made the flow you posted but I need an addition/tweek to that. Inbetween where the file is created and the approval is started I'm trying to figure out how to update that file with new informaton. I'm not really even sure if what I'm trying to do is possible in flow, or at least not without outright programming within the flow.

Helpful resources

UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Users online (1,861)