# Move File
Moves files between matter document libraries by processing rows from an Excel file. Each row identifies a source file by matter and relative path, and a target location by matter and folder.
Filename pattern: filename must contain movefile (case-insensitive).
Example: 20240115 MoveFile moves.xlsx
# Columns
| Name | Required | Description |
|---|---|---|
| ClientCode / SourceClientCode | No | Client identifier for the source matter. Defaults to empty string when omitted. |
| MatterCode / SourceMatterCode | Yes | Matter identifier for the source. Identifies the document library from which files are moved. |
| File / SourceFile | No | Relative path of the file within the source matter's document library (e.g. subfolder\document.docx). When omitted, the handler connects to the source document library but no specific file is targeted. |
| TargetClientCode | No | Client identifier for the target matter. Defaults to the source ClientCode when omitted. |
| TargetMatterCode | No | Matter identifier for the target. Defaults to the source MatterCode when omitted — meaning the file moves within the same matter's document library. |
| TargetFolder | No | Folder path within the target matter's document library where the file will be placed. Created automatically if it does not exist. |
| TargetFile | No | Full path (including filename) within the target document library. When this contains a path separator (/ or \), the directory portion is used as TargetFolder. |
MatterCode is always required.
# Behavior
The source document library is the first document library associated with the source matter. If the matter has no document library URL, the row fails.
The target matter is identified by TargetMatterCode and TargetClientCode. When either is not specified, it falls back to the corresponding source value — so a row with no TargetMatterCode moves the file within the same matter.
TargetFolder specifies where in the target document library the file is placed. When TargetFile is provided and contains a path separator, the directory portion of that value is used as TargetFolder instead. The target folder is created automatically if it does not exist.
If the source file is not found, the row is marked with an error but processing continues for other rows.
Rows are grouped by source matter and processed in batches. Within each batch, rows are ordered by target client code and target matter code before moving begins.
# Related links
- Search File and Move handler — search for files by query and move them in bulk
- Folder Set handler — create folders in advance
- Delete File handler — delete files instead of moving them