List Files
List Files
Section titled “List Files”Type: list-files · Package: Filesystem Activities v1.0.6 · Output: List
Returns a list of paths of the files (or folders) inside a directory. It is the basis of processes that work on many files: go through every Excel workbook in a folder, process each downloaded PDF, archive what arrived today. It supports patterns (*.xlsx), searching sub-folders and filtering by kind.
How it works
Section titled “How it works”Lists the content of the path folder. It filters by pattern, optionally goes into sub-folders (recursive) and decides whether to include files, folders or both (include). It returns the paths as a list of texts, which you usually loop over with For Each.
- Order: paths come sorted alphabetically. With
include = all, all folders come first and then all files. - Full paths: each item is the given folder plus the name (and sub-folders, when
recursive = true), ready to pass to another activity. - Snapshot: the list reflects the folder when the activity runs; files arriving later are not included.
- No side effects: it only reads the folder.
Required parameters
Section titled “Required parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
path | string | — | Folder to list. E.g. C:\downloads. |
Optional parameters
Section titled “Optional parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
pattern | string | "*" | Filter by name with wildcards: * (any sequence) and ? (one character). E.g. *.xlsx, invoice_*.pdf. A single pattern; ** and lists such as *.pdf;*.xml are not supported. |
recursive | bool | false | Include the content of every sub-folder. |
include | string | "files" | What to include: files, directories or all (both). |
Output
Section titled “Output”Returns a List of string with the matching paths. If nothing matches, it returns an empty list (it does not fail): check it with count(files) == 0.
Common errors
Section titled “Common errors”| Message | Cause and fix |
|---|---|
Directory not found. | path does not exist or is not a folder. Create it first with Create Directory or check the path. |
Access to the path '…' is denied. | No permission on the folder or (with recursive = true) on one of its sub-folders: in that case the whole search fails. |
'path' is required. | The path expression evaluated to null. |
Example
Section titled “Example”Process every Excel workbook in a folder and its sub-folders:
List Files path = "C:/data" pattern = "*.xlsx" recursive = true → output: filesLog message = "Found " + count(files) + " files"
For Each items = files itemVariable = path └─ activities: Read Excel Sheet path = path → output: table ... process ...Related activities
Section titled “Related activities”- For Each — loop over the listed files.
- Move File / Copy File — act on each file.
- File Exists — check a specific file.