Move file activity to move file into subfolders

HI there, I have a folders that have 10 company’s document. I am trying to move those 10 files to their respective subfolders, which are all in a main file.


The error show it cannot find the move filepath

Hi @RPA_Innovation

You need to pass the full path not only the name . CurrentFile.ToString and CurrentFolder.ToString

And also in you inner loop you are trying to move the same moved file which you cannot to multiple folders. So use copy file instead that way you can move the same file to multiple folders if needed and use a delete file outside the loop to delete it after copying


Hi all, I am trying to move the documents in a folder to subfolders respectively

For example, the first excel file in the first pic should go to the first subfolder in second pic… the second excel file should go to the second subfolder…etc.
I use two for loop to run it but unfortunately all the excel files go into the first subfolder.

May I know is there any other idea to solve this?

Duplicate Topic : Move file activity to move file into subfolders

It doesn’t have solution either T//T

Try like this

Before the both the for each create a list of string variable “FolderList”

  • Use Assign FolderList = New List(Of String)

  • Now inside the for each folder in folder

    • If 1 FolderList.Count>0
      • True 1-> If 2 Not FolderList.Contains(CurrentFolder.Tostring)
        • True 2-> move file to that folder
          • Use Append item to collection and add item as CurrentFolder.Tostring Refer the Link 1 ,Link 2
        • False 2-> leave Empty
      • False 1-> Leave Empty


Hi, could you please share your .xaml file? :pray: :pray:

Hi @RPA_Innovation


Move.xaml (8.2 KB)