Hi all,
I have an application and I am copying files from it and pasting in a folder. I should wait until all the files are copied. Which activity Should I use.
In the application sometimes there will be 10files to copy or 30files.

How do I go with this. Can you please let me know.

Hi @hanviprebday ,
I understand is you have 10-30 files need copy,
You need have original folder and target folder
To check complete copy, you can check file exist with list files → return true/flase
you can use count file in target folder Use Directory.GetFiles(“FolderPath”).Count
→ return number of file type in32
hope it help,

Get a count of how many files there are to copy.
Get a count of how many files are already in the destination folder.
Initiate the copy in the application.
Use a Do While to loop until the count of files in the destination is equal to the original source count and original destination count.

Hi @hanviprebday

To wait until all files are copied from one location to another in your UiPath workflow, you can use the “Wait For Download” activity. This activity is designed to wait for files to be downloaded or copied to a specific folder before continuing with the workflow. It’s a suitable choice for your scenario where the number of files to copy can vary.

Here are the steps to implement this in your workflow:

  1. Use the appropriate activities (e.g., “Copy File,” “Copy Directory,” or “Move File”) to copy the files from your application’s location to the destination folder.
  2. Drag and drop the “Wait For Download” activity into your workflow.
    In the properties of the “Wait For Download” activity, specify the following:
    Set this to the destination folder where you are copying the files.
    You can specify a file pattern (e.g., *.*) to match all files or use a specific
    pattern to match certain file types if needed.
    You can set a timeout value (in seconds) to limit how long the activity will
    wait for the files to appear. If the files are not copied within the specified
    timeout, the activity will exit with an error.
  3. After the “Wait For Download” activity, you can add any additional actions or logic you want to perform once all the files are copied. The workflow will automatically wait until the files are present in the destination folder or until the timeout (if specified) is reached.