История страницы
...
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.
Выходные параметры
Результат - коллекция, содержащая пути до всех вложенных элементов. Получить элементы коллекции можно с помощью действия "Получить значение по индексу".
Настройки
...
Вложенные элементы, пути к которым попадут в результирующую коллекцию.
По умолчанию "Все"
Выпадающий список:
- Все
- Только папки
- Только файлы
...
Способ, с помощью которого будет отсортировано результирующее значение. По умолчанию установлена сортировка по имени.
Элементы: По имени, По размеру, По типу, По дате создания, По дате изменения.
...
Способ, с помощью которого будет упорядочено результирующее значение. По умолчанию установлен порядок по возрастанию.
Элементы: По возрастанию, По убыванию.
...
Особые условия использования
- Сортировка возможна по имени, размеру, типу, дате создания и дате изменения объектов.
- Также выбранный способ сортировки может упорядочить содержимое папки по возрастанию или по убыванию.
- Если пользователь решит не использовать сортировку, в результате содержимое папки будет отсортировано по имени объектов по возрастанию.
- Если выбран способ сортировки, но не выбран порядок по убыванию/возрастанию, то по умолчанию действие отсортирует по возрастанию.
- Если выбран порядок по возрастанию/убыванию, но не выбран способ сортировки, то по умолчанию действие отсортирует по имени объектов в выбранном порядке.
- Есть возможность вывода скрытых файлов в результат.
- Если к папке отсутствует доступ - робот возвращает ошибку.
- Если при рекурсии отсутствует доступ к какой-либо папке/файлу - робот возвращает ошибку.
- Если при сортировке отсутствует доступ к просмотру информации о некоторых файлах/папках, то они выводятся ниже других файлов/папок в результирующей коллекции.
- При сортировке по дате создания, дате изменения и размеру - папки выводятся в конце списка.
Пример использования
Задача
в папке "Новая папка" расположены папки. Получить коллекцию всех путей до всех папок и путь до папки из коллекции с индексом 0.
Решение
Воспользоваться действием "Получить содержимое папки", "Получить значение по индексу".
Реализация
...
Результаты
Программный робот отработал успешно.