Search code examples
uipathuipath-studio

Can we delete available files in the particular folder using UiPath?


I downloaded one file (using the export button) and saved into some folder. Next time when I download the same updated file, I would like to remove the earlier downloads from the same folder. Will it be possible in UiPath? Can anyone have an answer to this?

I expect that folder should be empty before I download (using an export button) file from the application.


Solution

  • Via the Assign, use this method: Directory.GetFiles(targetDirectory). Then you have an array of files. Then via a Foreach, delete the files.