Rename File and Filename should contain current date and time

studio

#1

I am automating one Monitoring task. Whenever monitoring task gets completed, one Excel file is sent to the client. This Excel File’s name must contains the current date and time.

I am copying one Excel file format and pasting to the other folder. Now this new file’s name must contain the current date and time. Ex. the name of the file should be SRM-System-Check-14-04-2017_06_54.

Please find my xaml file.

test_filename.xaml (8.8 KB)


#2

I’m sorry what’s your question here?


#3

Now Please check the xaml file… I want to pass current date and time as a name of the file.


#4

string Destination = "SRM-System-Check-" + DateTime.Now.ToString("dd-MM-yyyy_HH_mm") + ".xlsx"

Should work.
Please also check below page for more details on date->string formatting:
https://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx


Append / Include Time and Date into downloaded PDF files name
#5

You need to set value to “dest” variable after you have initialized Filename.

or


#6

It is not working. I want to rename the file and File should contain current date and time


#7

What part is not working? Please share your xaml, looks pretty straightforward. You can either hardcode the datetime as mentioned by @andrzej.kniola or you can continue as you are doing, but declare dest after you have initialized Filename.


#8

Hi Chand,

it’s not the problem with Uipath. It is extremely with excel naming limitations.
Below is the screenshot for your reference.

To achieve your task, please do as below. First replace all un-supported characters from the date and give that name as your file name. Below is the sample artifact for this. Once you copied it to different location then move it to desired folder by using “Movefile” .

test_filename (3).xaml (9.2 KB)

Please get back to us, if it works or any challenges.

Thanks,
Rahul


#9

Thank you it worked :slight_smile:


#10

Hi ,

how to achieve this while in Save Attachment activity in Outlook.

Rgds
Aditi


#11

I have done the dest you have mentioned here, but the actual file is not saved there or anywhere else.

Could you please assist?02a_bits-centcity.xaml (44.3 KB)


#12

Managed to resolve this by playing around with the flow and this is the result

02a_bits-centcity.xaml (44.0 KB)