Merge Folders Command: mergeFolders
The mergeFolders command under the File Handler Functions is used to combine the contents of two source folders into a specified destination folder.
Example: Suppose you have two folders containing monthly sales reports, and you want to merge them into one consolidated folder.
Steps to configure:
- Choose Set a Variable Value from the Action dropdown.
- In the Element Key, input the variable name to store the result (e.g., mergeStatus).
- Click on Form to open the configuration window.
- Select Functions from the dropdown, then choose File handler Functions as the function.
- In the Cmd field, select mergeFolders.
- Provide the following parameters:
- Destination: Path to the folder where the merged content will reside (e.g., C:/Sales/2024/ConsolidatedReports)
- SourceFolder1: Path to the first folder (e.g., C:/Sales/2024/January)
- SourceFolder2: Path to the first folder (e.g., C:/Sales/2024/February)
- Click Save.


Outcome on execution:
- If the content of both source folders is successfully merged into the destination folder, the command returns true.
- If the operation fails (e.g., due to missing folders or access issues), the command returns false.
- The result is stored in the variable defined in the Element Key (e.g., mergeStatus). This variable can be used in later steps of your automation process to reference the stored information using syntax ${VariableName} (e.g., ${mergeStatus}).
Notes:
- The destination folder must exist prior to execution.
- The merge operation does not delete content from the source folders.