Loop: For each file in folder

Iterate over each file in a specified folder

Help Centre › Building Processes

Iterate over each file in a specified folder

Add it to a process

In the process designer, open the Add step tab. Find For each file in folder under Loop, or type its name in the search box, and drag it onto the canvas.

Fields

FieldRequiredWhat it does
Folder pathYesEnter the folder path, or use a variable such as {folders::desktop::path}\folder.
Loop variableYesName of the variable that will represent each item in the loop.
Maximum loopsNoLimit the maximum number of loop iterations. Leave blank for no limit.
MatchYesHow the filter rows combine: every row must match, at least one must, none may, or exactly one must. Choices: All of these (AND), Any of these (OR), None of these, Exactly one of these. Default: and.
Include sub-foldersNoAlso loop through files/folders in all nested sub-folders (recursive).
OrderNoBy name, or as SETA grant documents: each company's agreement first, then its addendums by number, each with {file::previous}, the document before it. Files that are not a contract are left out and named in the log. Choices: By name, SETA grant documents. Default: name.
Marks a transactionNoEach loop iteration is treated as a separate transaction for reporting.
Transaction keyNoFormula naming each iteration's transaction, evaluated per row against the live state (e.g. '{row[Reference]}'). Leave blank and every iteration reports the same key and cannot be told apart in reporting.
Transaction additional infoNoOptional. Anything else worth keeping about each item - leave blank and nothing is stored.
Transaction attachmentsNoOptional. Files to keep with EACH iteration, evaluated per row - one path per line, or a variable holding a path or a list of paths. Nothing is uploaded unless you fill this in.
KeysNoOptional filters. Rows of field/operator/value; a record must match to be looped.

See all Loop steps.

Errors

ErrorDescription
Folder not foundThe specified folder does not exist.
Folder is emptyThe folder contains no files.

Tips

  • Use conditions after the loop starts to filter files by extension, e.g. check if {file} ends with '.xlsx'.

Related functions

Get started

See it working on your own data

Everything documented here ships with the platform – try the document tools free, or have your first automation working in 7 days.