Copying files from one folder and moving to another folder

Hi All,

I have an interesting problem here. Let’s say we have a folder(Let’s call it Output) which has 2 subfolders inside it :- 1. Red and 2. Green.
Every day a process runs and these 2 folders inside Output gets populated with let’s say 3 excel files(3 files in each of the folder).
What i want is to create a uipath workflow wherein everyday when i run the workflow it empties the Red and Green folders and move the files to another Folder Named Archieve, But the tricky part here is that inside the Archieve folder whenever i am moving these files from Output i don’t just want to dump those files there but i want to create a token which differentiates today’s dumped file from yesterday’s, so everytim the files are getting dumped they should create another folder with today’s date as the folder name.



Please use the attached solution.Copying files from one folder and moving to another (2.7 KB)

1 Like

Hi @shivagowdavarad i get this error when i run the main file.


Hi @shekhawat.arjun1307 ,

Can you share a screenshot of your move file?
Try using the attached Main file, Have you set the actMain.xaml (6.7 KB) ual path for Output and Archive folder?

It works now, actually there was a spelling difference bw the archieve folder and what was there in the workflow.

Can you tell me how to modify the workflow if inside the Archieve — 03032021 folder also i wan to move the red file inside red folder and green file inside green folder.

First of all you have to create Red & Green Folder under date folder, using the same way how we have created Date Folder under Archive.
Then Inside for each prior to Move File activity add an if condition, item.String.contains("red) in then part of if add Move file(with Red folder as destination) and in else part of If add Move FIle(With Green folder as destination)

1 Like

But for that wouldn’t i have to create the date folder for all which in the current workflow is happening automatically inside the Move file activity?

You will be creating RED & green Folder under date folder right, the date folder is already created before For Each, so no need to create date folder again.

Hi @shivagowdavarad i am trying this solution but facing some issues i am attaching the error file and my workflow can you suggest why i am getting this issue.


Also just to check can you confirm that the way i am creating the green and red Folders are correct, i am giving the direct path inside the Archieve and Date Folder attaching the snap.



it is Item.ToString.Contains(“red”)

Thanks Bro @shivagowdavarad , Works fine.

1 Like

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