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 template file for use later in the workflow?

NeilWrenn
6 - Meteoroid

I am been searching for hours on here now and coming up short every time. Im sure im missing something simple but either way i just cannot get it done and its driving me mad. 

 

Essentially i have a template excel file with dozens of tabs that i would like to duplicate and write to with the new filename having text appended to it based on a field in my data. 

 

I have a macro to iterate through my data one record at a time, but i need to be able to create the file in order to write to them but im stuck. Ive tried looking at Blobs, as well as using Run Command but nothing is working. Can anyone outline a simple workflow that will achieve this? Just taking a copy of one file and writing it to another directory with a new name?

 

Anyone? 

9 REPLIES 9
Emil_Kos
17 - Castor
17 - Castor

Hi @NeilWrenn,

 

I have a solution like this for you.

 

The column names might be tricky. The first column is a location where the orginal fille is saved and the second one is a destination with a file name. 

 

Emil_Kos_0-1603209567651.png

Please mark it as a solution if this helped. 

 

AbhilashR
15 - Aurora
15 - Aurora

Hi @NeilWrenn, in addition to @Emil_Kos's suggestion, you could also use this Python SDK based solution created by one of our community members (@bobpeers) that allows you to move/copy files across folders. Need to think through how would one rename the file but this should hopefully help for now: https://github.com/bobpeers/Alteryx_SDK_FileCopyMove

 

Emil_Kos
17 - Castor
17 - Castor

Hi @AbhilashR,

 

Thanks for sharing. I will test this solution in one of my projects!

NeilWrenn
6 - Meteoroid

I cant figure out how to get that to work at all.... 😕

NeilWrenn
6 - Meteoroid

Hi, this fails as its looking for a batch file? it returns error code : 1

JosephSerpis
17 - Castor
17 - Castor

Hi @NeilWrenn I have got the blob tools to work in cases like this I've attached a simple example which shows to move files using the blob tools and renames the files you will need update the text inputs with a filepath on your PC to make that example to work. To incorporate this approach you will need to ensure the blob tools run before the Output Data tools (They need to be writing to the files being copied) so the data is pasted into those templates. I wrote a blog which showcases how you can do that. However essentially you need attach this processes to beginning of the workflow so that the templates are copied across before the Output data tools push data out.

Emil_Kos
17 - Castor
17 - Castor

Hi @NeilWrenn,

 

I think I know the answer. I am using the box folder and because of that, my path was set up dynamically. I believe that was the reason it didn't work for you.


I am sharing an updated solution.

 

The things you need to change are those two-column:

 

Emil_Kos_0-1603215449750.png

 

 

 

NeilWrenn
6 - Meteoroid

i dont know what im doing wrong....i replaced your strings with paths from my PC here and it still did the same... like thats not the issue. 

 

NeilWrenn_0-1603221977250.png

 

Emil_Kos
17 - Castor
17 - Castor

Hi @NeilWrenn,

 

I am getting an error code too but the solution works anyway and it copies the file to a different location:

Emil_Kos_0-1603222594925.png

 

Emil_Kos_1-1603222634789.png

Please verify if it isn't doing what you expect it to do. 

Labels