A sequence runs once a month, and a file is downloaded from a website - “file.xlsx”
Before the next time it runs, I want to rename the file to the date it was created like this:
“file - 2019-12-28.xlsx”
I’m using “Move File” and trying to incorporate (function(d) d.CreationTime) without much luck
1 Like
Add a variable and call it Today. Assign its value to be DateTime.Now.ToString(“yyyy-MM-dd”). When the sequence runs, it will populate with the date the file was downloaded.
In the destination of your Move File, use Strings.Replace(“file.xlsx”, “.xlsx”, " - " & Today & “.xlsx”)
This should result in your file renaming working as you desire.
Hi and welcome to the community!
To get the date as string you need:
File.GetCreationTime(“file.xlsx”).ToString(“yyyy-MM-dd”)
1 Like
Thank you!