Iterate Files – working through the files of a folder on the server¶
The command "Iterate Files" runs its inner commands once for every file in a folder of the application server. This page is for administrators who import files that another system drops into a folder.
1. At a glance¶
| Purpose | Loop over the files of a folder in the file system of the application server |
| Typical use | Import every file of a drop folder; check which files arrived |
| Where in the editor | Toolbar menu "Files" → "Iterate Files" |
| Needs a user interface | No |
| Related | Iterate File Lines, Write To File |
This command works with the file system of the server, not with the file storage that holds the files of records (see Add File).
2. Settings¶
The settings are on the tab "Settings". "Display Name", "Description" and "Execution Condition" are on the tab "General" (see Actions). The inner commands are placed in the lane of the command on the canvas of the action editor.
| Setting | Meaning | Default / Required |
|---|---|---|
| "Folder Path" | Expression for the absolute path of the folder, for example /data/import |
Required |
| "Recursive" | Includes the files in all subfolders | Off |
| "File Name Variable" | Variable that receives the name of the current file, with extension and without folder | At least one of the two variables |
| "File Info Variable" | Variable that receives details of the current file as JSON (see below) | At least one of the two variables |
File details¶
{
"FileExtension": ".csv",
"FileSize": 20480,
"FolderPath": "/data/import",
"ModificationDates": {
"CreationTime": "2026-10-19T22:00:04.0000000Z",
"LastWriteTime": "2026-10-19T22:00:04.0000000Z",
"LastAccessTime": "2026-10-20T06:00:00.0000000Z"
}
}
FileSize is in bytes, the times are UTC. The full path of a file is FolderPath, a separator and
the file name.
3. Behaviour¶
- If the path is empty or the folder does not exist, the command is skipped.
- The command lists the files once, at the start. Files that arrive while the loop runs are not included.
- For each file, the variables are set and the inner commands run. They work on the same record as the command and share the variables of the action.
- If an inner command ends the action or fails, the loop ends as well.
The order of the files is the order in which the file system returns them. nexxcite does not sort them.
The folder is read with the rights of the account the application server runs under. In a container installation, the path is a path inside the container – a folder of the host must be mounted into the container (see Installation and configuration).
4. Examples¶
Import all CSV files of a drop folder every night. A scheduled action runs an action with
- "Iterate Files", "Folder Path"
/data/import/orders, "File Name Variable"FileName, "File Info Variable"FileInfo. - Inside, a condition on the command below checks that
FileNameends with.csv. - Iterate File Lines with "File Path or Content"
/data/import/orders/followed byFileName, "Data Type"CSV.
There is no command that moves or deletes files in the folder. A file processed once is processed again with the next run – unless the other system removes it, the action remembers the files it has already imported (for example in records), or an external program started with Run Process moves it.
5. Limitations¶
- No filter by name or extension; use an "Execution Condition" on the inner commands.
- No command moves, renames or deletes files of the folder.
- Only for files that the application server can reach in its own file system.