Download file and save as "Todays Date"

Hi
Wondering if it is possible that when i click a link to download a file if its possible to always save it in this format: “Test” + CurrentDate.

So for example if i was to download an excel file today that the workflow would click the download link, the save as “Test12072019” which is todays date but if i was do run the same workflow tomorrow it would be “Test13072019” which would be tomorrows date.

Thanks!

2 Likes

This can be done using the following in assign

CurrentDate = DateTime.Today

2 Likes

Hello @shawnmurray

Use below expression

Currentdate = date. Now. Tostring(“ddMMyyyy”)

Regards
Ajay

2 Likes

@shawnmurray while downloading give like this buddy **“test”+now.tostring(dd/MM/yyyy)**it’s gonna save the file with today’s date.

3 Likes

Hi @shawnmurray
Yes You Can save Like this “Test”+System.datetime.now.date So it will save your file as Test+date .

2 Likes

Fine to get in this format kindly mention like this
"Test"+Now.ToString(“MMddyyyy”)+"yourfileextension"
like if you are trying to save a excel file
then
"Test"+Now.ToString(“MMddyyyy”)+".xlsx"

the output would be Test07122019.xlsx

Thats all you are done
Hope this would help you
kindly try this and let know for any queries or clarification
Cheers @shawnmurray

3 Likes

All,

Thanks guys for all your suggestions!!

Would it be best to use the Recording feature for the download then just implement the saving as yous have suggested once i get the save as pop up window?

Regards,
Shawn

1 Like

yeah, but depends how the download interaction goes. Do you have the opportunity to input a file name before saving? Or perhaps it goes directly to your downloads folder?

1 Like

@efleurent I have the opportunity to input a file name before saving

Thanks

1 Like

yes of course that would, you can include the above statements in the type into activity while performing typing to the save as field in the recording process
or even we can make changes to the value passed to the type into once after recording
Both will work for sure
Cheers @shawnmurray

2 Likes

Hi @shawnmurray

One method of achieving this is to download the file and move or copy to the desired location using the “Copy File” or “Move File” activity and change the file name to the desired name (in this case that would be “Test”+date.now.tostring(“ddMMyyyy”))

Refer to the screenshot below;

1 Like

so were you able to accomplish this @shawnmurray
any issues still

1 Like

Thanks guys that worked!

I will revert back should i run into future issues!

Regards,
Shawn

2 Likes

Great
Cheers @shawnmurray

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.