Hello,
I want the last step in my workflow to rename and move files to another folder (that includes yesterdays date), how do I do that
Hello,
I want the last step in my workflow to rename and move files to another folder (that includes yesterdays date), how do I do that
How do i rename it though? i used item + datetimenowtostring and got an error
I’m just running through item variable from a folder then using item + DateTime.Now.ToString(“dd-MM-yyyy”) and getting an error
Try like this,
Path.GetFileNameWithoutExtension("yours source file name").ToString+"_"+System.DateTime.Now.Date.ToString("MMddyyyy") + ".xlsx"
would I use item instead of the first part? Or can I use assign and get file name?
If your item containing full path of a file “C:\Users\Admin\Desktop\Trans.xlsx” then pass it like
Path.GetFileNameWithoutExtension(item).ToString+"_"+System.DateTime.Now.Date.ToString("MMddyyyy") + ".xlsx"
Move File: Could not find file ‘C:\Users\MichaelC\Documents\UiPath\QuickLibrary\Item11122019.xlsx’.
Was the error I got
Filename+System.DateTime.Now.Date.ToString(“MMddyyyy”) + “.xlsx” where I assigned filename using getfilename(“item”) but my folder isn’t the one above
this would be the expression that includes the yesterday date
Path.GetFileNameWithoutExtension(item.ToString)+“_”+System.DateTime.Now.AddDays(-1).ToString(“dd_MM_yyyy”) + “.xlsx”
Cheers @sparkplug93
Fine
you need to mention the path property with value as item.tostring and destination property as
Path.GetFileNameWithoutExtension(item.ToString)+“_”+System.DateTime.Now.AddDays(-1).ToString(“dd_MM_yyyy”) + “.xlsx”
Cheers @sparkplug93
I’m getting the same error. It is looking for item in the wrong folder.
Fine
may i know what is the value of item.tostring, kindly check once whether the folder path has that file in it
Cheers @sparkplug93
my folder is report\filename and it’s looking in the uipath\filename
yep. I used another assign getfiles and that is also looking in the incorrect folder
@sparkplug93
print this “item.ToString” in a Write Line and check whether it has the expected file path or not
Yes it is
yes it is