This Macro has multiple actions with the purpose of moving or copying assets (files or folders) to a new location. In addition to an assortment of different actions for moving files, folders, or their contents, there is also a selection for an override policy. This should be used to decide whether the Source Asset replaces an Asset of the same name in the Destination Location. Polices that can be used are:
- Always
- If there is an asset with the same name in the Destination Location, the Source Asset will always be copied or moved. This will replace the original file in that location.
- Newer
- If there is an asset with the same name in the Destination Location, the Source Asset will be only be copied or moved if it is newer than the original asset.
- Older
- If there is an asset with the same name in the Destination Location, the Source Asset will be only be copied or moved if it is older than the original asset.
- Smaller
- If there is an asset with the same name in the Destination Location, the Source Asset will be only be copied or moved if it is smaller than the original asset.
- Larger
- If there is an asset with the same name in the Destination Location, the Source Asset will be only be copied or moved if it is larger than the original asset.
- Never
- If there is an asset with the same name in the Destination Location, the Source Asset will never be copied or moved.
Actions that can be used are:
- Create Folder
- Creates an empty folder in the Destination Location.
- Copy
- Copies an individual Asset from the Source Location to the Destination Location.
- Only a single Asset can be copied at a time.
- The Asset can be a file or a folder.
- If the Asset is a folder, the folder and all of the folder contents will be copied.
- If the Asset is a file, you must include the file name and extension in both the Source Location and the Destination Location.
- If the Destination Location Asset name is different than the Source Location Asset name, the newly copied Asset will use the new name.
- Copy Contents
- Copies all files from the Source Location to the Destination Location.
- The Source Location and Destination Location must both be existing folders.
- Only files will be copied.
- Folders contained inside the Source Location will be skipped.
- All files copied over will retain their current name.
- Move
- Moves an individual Asset from the Source Location to the Destination Location.
- The Asset can be a file or a folder.
- If the Asset is a folder, the folder and all of the folder contents will be moved.
- If the Asset is a file, you must include the file name and extension in both the Source Location and the Destination Location.
- If the Destination Location Asset name is different than the Source Location Asset name, the newly moved Asset will use the new name.
- Move Contents
- Moves all files from the Source Location to the Destination Location.
- Only files will be moved.
- Folders contained inside the Source Location will be skipped.
- All files moved over will retain their current name.
- The Source Location and Destination Location must both be existing folders.
This Macro will only work for Alteryx version 2021.1.4 or higher.
Disclaimer:
Download includes both the Macro and a Demo Workflow for how to use the Macro. The Demo Workflow is not required to use this Macro.
Files and Folders are moved using Python and the SHUTIL package. This package should be included by default in your Alteryx Environment.
If there is a file/folder that already exists in the new location with the same name this tool WILL replace it. Please ensure that the location that you are using for the Destination Location is either empty or intentionally being replaced by the file/folder located at Source Location.
This tool is not endorsed by Alteryx Inc. and will not be supported by Alteryx Support or any member of Alteryx Staff. Alteryx Inc. is not responsible for the results of using this Macro. Please test this tool prior to using it with any file(s) or folder(s) that are important. Please ensure you have backups of any data prior to using this tool to move them.