Files Handling

Get Files/Folders 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 NameParameter TypeIn/OutDescription
Alternative Scenario If FailedBooleanInputcheckbox; default is "on"
Display NameLiteralInputchanges display name of the activity
Exclude from Transaction CheckBooleanInputcheckbox; default is "off"
Folder PathStringInputdirectory path to a folder
Search for foldersBooleanInputcheckbox; default is "off"
Search PatternStringInputstring to match
Files/Folders ListString[]Outputvariable that will store the list of files
ResultBooleanOutputreturns a Boolean value. True if no error in activity, otherwise 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