Is there a way to move files from one directory to another without using the Run Command tool? I created a workflow that uses it and it runs perfectly but not on our server.
Solved! Go to Solution.
The only other way is to import the data, and then use an output to write it to a different location.
To do a straight copy and paste to another location will need the run command. You are probably having issues because your Server is on Safe mode. Your admin can change this.
That's what I figured but I was hoping someone out there had some magic for me. 🙂
Thanks!
I am doing the following with python developer tool task and it works.
I am using Directory input tool --> dynamic tool --> formula tool-->python tool
(make sure that filename is passed correctly to python tool)
Step 1. from ayx import package
Step 2. from ayx import alteryx
df=alteryx.read("#1")
Step 3.from ayx import Alteryx
import shutil
FileImportpath='\\\\Directorypath\\Folder1\\Folder2\\...\\'
FileExportpath='\\\\Directorypath\\Folder1\\Folder3\\....\\'
Step 4. filename=df['FileName'].unique()
filename=filename(0)
print(filename)
Step 5.
FileImportPath=FileImportPath+filename+'.txt'
FileExportPath=FileExportPath+filename+'.txt'
print(FileExportPath)
Step 6. FileExportPath=FileExport+filename+'.txt'
Shutil.move(FileImportpath,FileExportpath)
print('move')