In case you missed the announcement: Alteryx One is here, and so is the Spring Release! Learn more about these new and exciting releases here!

Alteryx Designer Desktop Discussions

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

Moving Files to Specific Folder

KamenRider
11 - Bolide

Hi @Felipe_Ribeir0 and guys,

 

I tried your macro of moving files, and I got an error. Can you please help me with this? See below error.

 

Move files.PNG

If there's any other way the easiest that workflow can call, please do also let me know.

 

Please advised.

 

Thanks, 

Kamen

 

 

14 REPLIES 14
Felipe_Ribeir0
16 - Nebula

Hi @KamenRider 

 

This seems related to passing invalid FileOrigin/FileDestination parameters to the macro. You must pass valid filepaths (you can test it copying them and trying to open them with your windows explorer), and each FileOrigin/FileDestination must be unique.

 

gif3.gif

 

 

KamenRider
11 - Bolide

Hi @Felipe_Ribeir0 

 

Thanks for the response. Here's my plan, I wanted to remove the previous files and send to archive folders. I do hope my workflow sequence will works as below:

 

Remove First before copy template.PNG

 

Is is possible that the origin of the files is not in the folder just like below? I noticed that your macro origin is from folder to folder, however mine reports starts not a folder to call. Can you help me how we can change the configuration. I tried to put "" in the formula tool instead of a folder name but it is not working.

 

Remove Reports.PNG

 Please advised.

 

Thanks,

Kamen

Felipe_Ribeir0
16 - Nebula

Hi @KamenRider 

 

As long as you use full valid windows filepaths, it will work.

 

For example, for the bellow file it is C:\Users\user01\Downloads\Batch Input (1)\FileToMove.xlsx

 

Felipe_Ribeir0_0-1672086122146.png

 

rachelgomez
7 - Meteor

Moving and Copying Files & Folders
Right-click the file or folder you want, and from the menu that displays click Move or Copy. The Move or Copy window opens.
Scroll down if necessary to find the destination folder you want. 
Click anywhere in the row of the folder you want.

 

Regards,

Rachel Gomez

KamenRider
11 - Bolide

Hi @Felipe_Ribeir0 

 

May I ask what will be the syntax in the formula tool you have since I don't want my files to be put in another folder. I tried changing the syntax to REPLACE ([FILE_ORIGIN], " ", 'OUTPUT ARCHIVE') but it is not working.

 

Remove Reports2.PNG

 

As stated I would like my 3 files in kind of scenario.

 

Remove Reports.PNG

Please advised

Kamen

Felipe_Ribeir0
16 - Nebula

Hi @KamenRider 

 

You could try to type the full path manually and concatenate it with the filename like this:

 

Felipe_Ribeir0_1-1672140910714.png

 

 

KamenRider
11 - Bolide

Hi @Felipe_Ribeir0 

 

I was able to change its destination path in formula tool and along the way of running the workflow, I've encountered an error saying file is already exist in the destination path. Is it possible that macro can overwrite the files in the destination folder? 

 

I also noticed that moving does not follow the "block until done" tool because while it should work the first process, it works the last. Not sure why?

 

Please see my screenshot below.

 

Error Move.PNG

 

Please advised.

Kamen

Felipe_Ribeir0
16 - Nebula

Hi @KamenRider 

 

Unfortunately this macro does not have the capability to overwrite files yet. I will put this capability on the next week.

 

About the block until done, when you have some a little more complex scenarios it does not always work as you first expect. One way of dealing with this is using the append tool to allow the cmd to work just after you move the files, like this:

 

Felipe_Ribeir0_0-1672169140181.png

 

 

 

 

 

KamenRider
11 - Bolide

Hi @Felipe_Ribeir0 

 

I tried your suggestion however, I still got an error in moving the files. Still the process of moving the files first did not work as it should be because before it move the first two files in the Output Archive, I see template saving on the drive and later 3 errors occurred.

 

I made some observations. If the output folder does not have anything to copy to the output archive, running the workflow is successful (copy to template the data and renaming). By the way, I made some changes on my workflow as follows:

 

New Confi.PNG

 If the Output has the 3 data files, running the workflow to move the files is not working. It will just move the other two files and then errors will be generated. By the way, I'm using network drive in my origin and destination and I am not sure if your macro will read this.

 

Aside from that, the workflow also gives an error if the files in the output folder has duplicates or already exists in the Output Archive folder. (hope you could share me your updated macro where overwriting data is possible)

 

Another error is under my cmd as follows: Hope you could advised me how to fix this one.

 

return and error code 1.PNG

Thanks and looking forward you could still assist me in solving this scenarios until it will work perfectly.

Kamen

Labels
Top Solution Authors