Move files based on today's date

Hello Community,

I’d like to move multiple files downloaded in the folder to a different file based on 2 conditions -
Date Modified - Today
and File Name

I tried using condition builder, it worked for file name but I’m not too sure on how can I accomplish the 2nd condition - “Date Modified - Today”

Thanks!

Hello @Super_Sonic

Are there only 2 files or multiple files?

If only one file you can do as below to get the latest filename.

String.Join(“parameter”,Directory.GetFiles(FolderPath,”*”).OrderByDescending(Function(d) New FileInfo(d).CreationTime).Take(1))

if need particular file name, then replace * with the filename.

Thanks

Multiple files, Rahul.

And, I’m trying to move them from Downloads folder to a dedicated folder.

Thanks! :slight_smile:

If multiple files, then the filename will be different right? You can use the above expression and get the latest file. Then use the move File activity to move that to the desired destination.

Thanks

1 Like

Hi @Super_Sonic ,
I am sending you a sample workflow which will fetch you all the files from the folder path you specify according to the modification date as today with highest accuracy. And you can also move those files to your desired destination.
Demo_GetFilesByXDate.xaml (6.9 KB)

Provide your input folder path here:

Provide your destination folder path here:
image

Thanks & Regards,
Shubham Dutta

1 Like

HI @Super_Sonic

Try the for each file in folder activity
image

Regards
Sudharsan

1 Like

Hi @Super_Sonic ,
If you do not have any more queries please mark the solution and close the thread.

Thanks & Regards,
Shubham Dutta

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