LOOP Each file in a folder function

The LOOP Each file in a folder function in RPA.

Help CentreBuilding Processes

This article describes the RPA Loop functionality to each file in a folder.

For a full list of available functions, please read LOOP functions.


Description

The LOOP Each file in a folder function allows you to each file in a folder.


Setting it up

To use the LOOP Each file in a folder function, follow these instructions:

{{popups:rpas/add:action=loop-files}}

Once on a process map:

  1. Navigate to the process where you would like to add the LOOP Each file in a folder function
  2. Click on the green button’s drop-down (right side of the green button labelled “Process”)
  3. On the menu that appears, click on the “+ Activity” item
  4. From here you can select the LOOP Each file in a folder option
  5. Click "Add" once you are done

Input parameters

ParameterRequiredTypeDefaultDescription
Folder pathYesTextPath to the folder to loop through.
VariableYesTextLoop variable name to access the current file path.
Include sub-foldersNoBooleanOffInclude files from sub-folders.
Max iterationsNoNumberMaximum number of files to process.

Output variables

VariableTypeDescription
VariableTextFull path of the current file in the loop.

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

See it working on your own data

Everything documented here ships with the platform – try the document tools free, or go live in 7 days.