moveFileToFolder
(FintechOS Studio 20.1.3 and later)
Moves a file to a known folder.
Syntax
Copy
function moveFileToFolder(sourceFileName : string, destinationFolderName : WorkflowKnownFolders): void;
| Parameter | Type | Description |
|---|---|---|
sourceFileName
|
string | Path to the file including the file extension. The file should be stored in a known folder, eg. Import/test1.csv. |
knownFolder
|
WorkflowKnownFolders | Name of the known folder:
|
Examples
In this example, we recover the BankingProduct_EntityStatusSettings_fe45fd7a-1a56-43c6-82b5-020b0c83941d.xlsx file from the $RecycleBin.
Copy
moveFileToFolder('$RecycleBin/BankingProduct_EntityStatusSettings_fe45fd7a-1a56-43c6-82b5-020b0c83941d.xlsx', '');
In this example:
- We read all the files in the temp folder in an array called files. See listFilesFromFolder for details on how to retrieve all the file names from a known folder.
- We iterate over each file an move it to the $RecycleBin folder.
Copy
let files = listFilesFromFolder('temp');
for (i = 0; i < files.length; i++){
moveFileToFolder(files[i], '$RecycleBin')
}