Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

How to copy a file from one folder to another

haya
8 - Asteroid

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

13 REPLIES 13
jdunkerley79
ACE Emeritus
ACE Emeritus

Take a look at this post https://community.alteryx.com/t5/Data-Sources/Move-jpeg-files-to-different-folder-depending-on-file-...

 

It moves rather than copies but you could change the formula to be COPY rather than MOVE and should do what you need.

mbarone
16 - Nebula
16 - Nebula

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!001.png

pbrink
8 - Asteroid

How can I find this macro?  Thanks

mbarone
16 - Nebula
16 - Nebula

It's something I created for my specific use case.  I've tried attaching it to this post in case it suits your needs as well, but I am unable.  Keep getting the error "The contents of the attachment doesn't match its file type.".

You can zoom in and probably re-create it yourself without too much trouble.

mbarone
16 - Nebula
16 - Nebula

Here, I dropped it in a YXMD.  You should be able to save it out to your Macro repository.

pbrink
8 - Asteroid

Awesome Thanks.

pbrink
8 - Asteroid

Is this what I am supposed to see in the macro? View attached .

 

Is there where I enter from location and to location?

 

Thanks

mbarone
16 - Nebula
16 - Nebula

If you open the YXMD I attached, in Alteryx Designer, you will see one tool sitting there on the canvas.  This tool is the macro that will copy your files.  If you right click on that tool and choose open macro, then a new canvas will open and show you the "innards" of the macro, which is what my original screen shot above is.  If you simply click on the tool, you will see in the configuration tab instructions on where to enter what.

pbrink
8 - Asteroid

Hello,

I have opened the YXMD1 workflow and I see the macro. I am unable to right click and see the option of open macro. I do not think I need to know the innards.  When I click on the macro I see the configuration scripts but I am unable to get pat the entry point is invalid error. I have tried different input data points and entering data into the config script.

Labels