cancel
Showing results for 
Search instead for 
Did you mean: 

Save files with timestamp as [filename + timestamp . extension]

Hey all,

 

I would love to see this very simple addition that we can rename files to include a timestamp in some form. That could be either the whole timestamp, a date or a time or maybe anything in between. This would be awesome for using some functionality as backup, so that first of all the dates are correct and second it doesn't overwrite, hence the backup.

 

Thanks.

 

Coen

Status: Completed

This work has been completed. You can read more about it here: https://flow.microsoft.com/blog/nested-apply-to-each/

Comments
Level: Power Up

 I am simply add the "Received Time" "File Name" in *File Name field. Is working too, do a try!

 

 

Level: Powered On

Agreed - I dont think this was solved via the solved reference, but I have been using the guidance from this thread to modify the attachments by appending the time the email was recieved to the attachment name.

 

Basically ,Using "Compose" :

  1. Get the filename;     first(split(variables('AttachmentName'),'.'))
  2. Get the Extention;    last(split(variables('AttachmentName'),'.'))
  3. Concat them with a timestamp;  concat(outputs('Compose-GetFileName'),'-',variables('Timestamp'),'.',outputs('Compose-GetFileExtension'))

I use this format for my timestamp, and in my case, since it drives from email attachments, I use the message date, but you could use the file create date:

 formatDateTime(body('Convert_time_zone'),'yyyyMMdd-hhmmss')

 

Results in 

"[filename]-yyyymmdd-hhmmss.EXT"  i.e. Testfile-20190418-081840.pdf