Week 2: Practice: Organizing your local drive

I am having trouble with the the Organizing Your Local Drive from week 2. I have checked my work against the “Solution” version, and rewatched Priya’s video. I do not see where the glitch is.

The project works fine up to (and including) the point of moving the first image file. It correctly creates the Sorted folder and the Images folder. It correctly lists ALL the files in the project notebook. After moving the first image file, none of the other folders are created, and ALL the rest of the files are deleted from the source Files folder.

Any insight would be appreciated. Project - Organizing Your Local Drive.zip (80.9 KB)

Hi @chesbro.john - I found 2 errors in your code:

  1. You check if the ‘sorted_files’ exists and would create if it is ‘true’ → this needs to be changed to ‘Sorted Folder Exists’ is false

  2. In the PDF case you create the folder here - Desktop\UI Path Education\Week 2\2 Working with Files & Folders\Organize Your Local Drive\Sorted_Files\PDFs - instead of the project folder to which you want to move the file afterwards. The folder on the desktop is also used to check if the folder exists for the PDFs which is then ‘true’ but can’t be found in the project folder.

After changing these two items the workflow worked for me.

1 Like

Thanks son much for looking into this. I revised those two items and am still getting the same result (only one image file moved, all files deleted. I have attached my revised workflow.

Project - Organizing Your Local Drive REV.zip (93.5 KB)