Sync 3 folders on PC

I want to synchronize files in 3 Folder.

If a file is downloaded (version change)in Folder # 1 (data been adding to it).The name of the file will remain same

  1. Robot should search for the file in Folder # 2 and replace.
  2. Robot should search for the file in Folder # 3 and replace.

Hi @Rupendankhara
we can use PATH EXISTS activity and check for the file in that folder and can replace with Copy file activity
Cheers @Rupendankhara

1 Like

I am new to coding. Would be able to provide workflow file. Really appreciate it.

Thanks

1 Like

Will ut check for updates. Like i said it should only replace older files when the file in first folder updates

Maybe with Event Monitor you could monitor for changes in Folder #1 and according to the type of Event(new file, changed, created, deleted, etc) robot can execute other actions

General Logic could be like this

if Event in folder1 is New:
    get new FileName in folder1
    if Directory.getFiles(folder2).contains(FileName):
       Delete FileName in folder2
       Copy FileName from folder1 to folder2

Let me try and make a work flow

Sir, how do you make this happen in Uipath

.
I am stuck here.

Add File Change Trigger Inside Monitor Events. Set ChangeType, Path and Filename to monitor
Make sure in Monitor Events block property RepeatForever is set according your needs.

Done, what next

in Event Handler block, add your actions when a new file (if conditions were met) is created/changed/deleted
Make sure you catch Filename and then make rest of your logic process.

Didn’t get you. Sorry.

  1. Create file1.txt before run
  2. Run Robot
  3. Add o change file1.txt content and save.
  4. A messagebox should appear

Yes instead of message box, i am looking to delet the old file and add the latest versions. How do i do that.

@Rupendankhara

Use Move File Activity and specify source and destination file folders.

That’s your part :slight_smile:
image
Check All file-related activities in UiPath Studio

Well. The file Should be existing in both folder. I just want the most updated version of it.

1 Like

Thanks for all your help.I will try.

@lakshman can you provide workflow please.

@Rupendankhara

In this case, use Copy File Activity to copy file from source to destination folder.

Will that replace the older file?