If you require to move a specific file type from one path to another in your local machine, follow the below instructions:
Illustrated in the images below is how the flow will look. The File System List source step is being used to return the list of files from a path on your local machine. The Filter step is extracting the specific file type from a list of files that is in a folder/ path. A sub-flow is used to send the specific file types to the Relay Base File Systems Action step which will move the files to another path on your local machine. The Start Flow step is used as a source step in the sub-flow.
- Create a relay a File System relay. The below link assists on how it is done:
- Add a Pass Through step as a reader step and then add the File System List source step. The below image is the File System List source step where the relay is selected from the highlighted icon which expands to a drop down list. The Path field consists of the path where the files are located.
When the Pass Through step is tested, all the files that are located in the path gets returned as shown in the image below. There are different file types in the folder.
- A Filter step is added with the code in the below image that returns the files based on the file name and the file extension/ type. In this example, we want to move only the Excel files that are in the location.
A Calculator step is added to test the Filter step to see which files gets returned. In the image below, 2 files are being returned since we require to move only the Excel files.
- A Sub-Flow is added. A Start Flow is added and used as a source step. The Pass Through step automatically gets added when you add the Start Flow step. The Set Parent Record is ticked to pass the files into the sub-flow as shown in the below image.
NB: If you require to read/ manipulate the data from the files, remove the Pass Through step and add a reader step that will read that particular file type.
- Add a Combine step and then add the Relay Base File System Actions destination step to move the files. The image below is the configuration to move a file. The relay is selected from the drop down list and the Move File operation/ function is selected. In the From Path field,
@inputRecord.pathis used to reference the filtered paths and the To Path field is the path where you want to move the files to.