Folder list Version 14 (Python)
Action group: File system
Description
The action gets paths to all folder elements.
Action icon
Parameters
Input parameters
Folder - path to the directory, whose content should be returned. Example: C:\Users\qrupl\Desktop\Test
Objects type - type of objects to be obtained from the specified folder. Available options: All, Only folders, Only files.
Use recursion - if the value of the boolean variable = true, all paths to attachments in the selected folder and each subfolder in it will be read. If the value of the boolean variable = false, the paths to attachments only in the selected folder will be read.
Sort type - the method by which the resulting value will be sorted. Available dropdown list values: By name, By size, By type, By creation date, By modification date. Sorting will result in a collection with sorted values.
Sorting order - the way in which the resulting value will be ordered. Available dropdown list values: Ascending, Descending.
Hidden files - if set to "true" , hidden files will also be displayed in the result. More about viewing hidden files: Show hidden files and folders in Windows
Output parameters
Result - collection of every nested element path. You can get the elements of the collection using the "Get value by index" action.
Settings
Property | Description | Type | Filling example | Mandatory field |
---|---|---|---|---|
Parameters | ||||
Folder | Path to the directory, whose content should be returned | Robin.FolderPath | C:\doc\img | Yes |
Objects type | Nested elements, the paths to which will be included in the resulting collection. Default «All» | Robin.String | No | |
Sort type | The method by which the resulting value will be sorted. The default is to sort by name. | Robin.String | No | |
Sorting order | The way in which the resulting value will be ordered. The default is ascending order. | Robin.String | No | |
Hidden files | If set to «true», hidden files will also be displayed in the result. | Robin.Boolean | true | No |
Use recursion | If the value of the boolean variable = true, all paths to attachments in the selected folder and each subfolder in it will be read. If the value of the boolean variable = false, the paths to attachments only in the selected folder will be read | Robin.Boolean | true | No |
Results | ||||
Result | List of every nested element path | Robin.Collection |
Special conditions of use
- Sorting is possible by name, size, type, creation date and modification date of objects.
- Also, the selected sorting method can organize the contents of the folder in ascending or descending order.
- If the user chooses not to use sorting, the result is that the contents of the folder will be sorted in ascending order by object name.
- If a sorting method is selected, but no descending/ascending order is selected, the action will sort ascending by default.
- If ascending/descending order is selected but no sorting method is selected, the action will sort by the name of the objects in the selected order by default.
- It is possible to display hidden files in the result.
- If the folder is not accessible, the robot returns an error.
- If there is no access to any folder/file during recursion, the robot returns an error.
- If there is no access to view information about some files/folders during sorting, they are displayed below other files/folders in the resulting collection.
- When sorting by creation date, modification date and size, folders are displayed at the end of the list.
Example of use
Task
There are folders in the "RPA" folder. Get the collection of all paths to all folders and the path to the folder in the collection with index 0.
Solution
Use the "Folder list", "Get value by index" actions.
Implementation
- Assemble a robot scheme with the actions:
- Set the "Folder list" action parameters.
- Set the "Get value by index" action parameters.
- Click "Start" in the top panel.
Result
The program robot completed successfully.