Hi,
Can you please provide a sample workflow to copy a file from one folder to another folder using alteryx (Kind of taking backup of files).
Regards,
Haya
Take a look at this post https://community.alteryx.com/t5/Data-Sources/Move-jpeg-files-to-different-folder-depending-on-file-names/m-p/90362#M6589
It moves rather than copies but you could change the formula to be COPY rather than MOVE and should do what you need.
I have users that wanted a macro that simply takes all files of one type (e.g., xlsx, csv, yxdb) and simply copies them from one folder to another (for backup, as you mentioned).
I created this simple macro for them. Enter the "from" location, the file type, and the "to" location, and it will do just that. Every time it runs, in addition to copying the files, it creates a simple text file in the "to" folder that tells the date and time the copy was completed (that way if you schedule it you can always check to see when the last update was, although if it's scheduled you should already know, but hey, you have to output something, so why not this).
Hope this helps!
How can I find this macro? Thanks
Is this what I am supposed to see in the macro? View attached .
Is there where I enter from location and to location?
Thanks
Or you can use python with a function like this:
from ayx import Alteryx import shutil import os import pandas as pd def archiving(a): source=a['filepath'].tolist() destination=a['destination'].iloc[0] destination=destination.replace('\\','/') source=[shutil.copy(each,destination) for each in source] dicty={"newfiles":[destination+os.path.basename(each) for each in source]} output=pd.DataFrame.from_dict(dicty) Alteryx.write(output,1) df=Alteryx.read("#1") archiving(df)