Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

Flow renames file only once and then replaces them



I have below from which downloads attachment (picture) from email and saves it to folder on One Drive. Because I already have the same filename there, before saving, I rename the old picture and add timestamp to it, then save it to the same directory. This happens OK for the first time.



concat('/Email attachments/','filenamehere',utcNow(),'.png')




But next time the flow rename the original picture from email but instead of renaming it to a new file, it replaces the old rename file which already had timestamp.

 So it keep adding new files because the timestamp is different than the file renamed 5 minutes ago.


Hope it's clear.





I understand it like when I am selecting the file to rename in the flow I have to select specific file to which the workflow probably assigns a hash code and stick with it no matter the filename. I will try to put there expression instead of specific file.

Super User II
Super User II

Re: Flow renames file only once and then replaces them

HI @jakub_ 


Try doing everything in one step. In the create file, you can add the name you want to the file so that you can rename it with the timestamp directly. No need to move since all files you create are unique.


Also, instead of a timestamp, you can add a random number to ensure that you always have a unique file.


Makes sense?


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


Frequent Visitor

Re: Flow renames file only once and then replaces them

I can try it but as I understand it I would not have a file without timestamp. The file is a picture and this picture is linked to a PP presentation so if I don't keep the latest file with filename without timestamp the link to PP will not work.

Helpful resources

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.

Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Top Solution Authors
Users online (5,749)