This snippet is designed to group all files into different subfolders based on file extension. The folder path is provided by the user. This workflow accepts the following input arguments:
in_strOptionByUser (String) - represents the value to decide whether the bot should start or not.
in_strUserInputFolderPath (String) - represents the folder path to organize the files.
in_strUserInput (String) – represents the selected option (out of 3 options – Create new folder, Add in existing folder, Keep in Miscellaneous), chosen by the user if file type is unknown.
This workflow can be used to organize any given folder. It comes preloaded with the essential file types and folder structure. The file types defined in the Config file are:
o Compressed - .zip
o Pdf – .pdf
o Excel_WordDoc – .doc, .docx, .csv, .xls, .xlsx
Photos - .png, .jpg, .bmp, .jpeg
Videos - .mp4
Music - .mp3
Application Setup - .exe, .msi
It asks the user to select the folder he/she wants to organize, loops all the files present in the folder, checks the extension of each file and moves it into the respective subfolder. More file types can be pre-defined in the Config file just by adding a row and entering the details ‘File extension’ and ‘Folder Name’. For any file which has an unknown extension, it gives the user the three options below:
Create a new folder – Creates a new subfolder with the name entered by the user and moves the file to that subfolder. It also adds this file-folder mapping into the Config file and moves all the files with this extension to the required subfolder.
Add in existing folder – Gives a drop-down option to the user and moves the file to the chosen subfolder. It also adds this file-folder mapping into the Config file and moves all the files with this extension to the required subfolder.
Keep in miscellaneous – Moves the file to the miscellaneous subfolder.
This workflow also gives the user the option to move all the personal files to the personal subfolder if the ‘Username’ is filled in the Config file. The bot will check the name of each file and if it has ‘Username’ in it, it will create a sub-folder named “Username” and moves the file into it.
The goal of this snippet is to save time and organize subfolders by moving all the files into specific subfolders. It gives users the ability to add their custom mapping for the folder and subfolder mapping for the required file types, if not already present.