Showing results for 
Search instead for 
Did you mean: 
Level: Powered On

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
Super User

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.


Level: Powered On

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


New Ranks and Rank Icons in April

Read the announcement for more information!


Better Together Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.


New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!


Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!


Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

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