Get File/Directory List
This activity gets a list of files from a specified folder. This activity is meant to be used in scenario when you need a robot to process a package of files in a loop.
You can use use wildcards: ? to replace any character, an asterisk (*) to replace any sequence of characters, so pattern “*.txt” finds all text documents in a given folder, “bb*” find all files that name starts with double “b”. When you leave Search pattern field empty - it finds all documents in a given folder.
Using this activity you can also get a list of subfolders in a specified folder (tick the box Folders in Properties window).
When there are no files/subfolders matching pattern, activity returns an array of length 0.
Parameter name | Parameter Type | In/Out | Description |
---|---|---|---|
Alternative Scenario If Failed | Boolean | Input | checkbox; default is "on" |
DisplayName | Literal | Input | you can change the name of activity for greater clarity of the scenario |
Folder Path | String | Input | full path to a folder (D:\directory_tree\) |
Search for folders | Boolean | Input | checkbox; default is "off" |
SearchPattern | String | Input | string to match |
FileList | String[] | Output | variable that will store the list of files |
Result | Boolean | Output | returns the Boolean value: it will return True if no error is in activity, otherwise it will return False |
Result Code | Int32 | Output | Result Code will return 0 if there is no error in activity, otherwise in most cases it will return 1, the extended result code will show only in several chosen activities |