Utilities

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.

getfilelist
Parameter nameParameter TypeIn/OutDescription
Alternative Scenario If FailedBooleanInputcheckbox; default is "on"
DisplayNameLiteralInputyou can change the name of activity for greater clarity of the scenario
Folder PathStringInputfull path to a folder (D:\directory_tree\)
Search for foldersBooleanInputcheckbox; default is "off"
SearchPatternStringInputstring to match
FileListString[]Outputvariable that will store the list of files
ResultBooleanOutputreturns the Boolean value: it will return True if no error is in activity, otherwise it will return False
Result CodeInt32OutputResult 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