Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Copy template before running workflow

Anastasiia
8 - Asteroid

Hello, 

 

I have an excel file with various sheets, one of which contains data, the rest are graphs that are generated from data sheet. Each week I need to update a data sheet with a new data from source raw data file.  I need to replace some columns starting from column M. Before column M there are formulas which will be updated when data is entered starting from column M.

 

I managed to do these steps but I have few more tasks to solve.

1. I need to create the output always with the new version and couldn't figure out how to do it. 

2. Also I should use a new template instead of overwriting a sheet from the previous file, because number of rows might be larger in previous file. I cannot replace the sheet as some of columns in this sheet have formulas.  

flow.PNG

 

 '

 

Anyone has suggestion how to do these two steps? I found in forums that I most likely need to create a bat file and use run command tool. So far I couldn't understand how to use it in this case. 

5 REPLIES 5
AmeliaG
Alteryx
Alteryx

Hi @Anastasiia,

 

Thanks for your question! I've attached a workflow which dynamically creates  script to:

 

1. copy a template file

2. save the template file with a new name (delete file with new name if previously created)

 

This is the approach you will want to use in your use case. 

 

Hope this helps!

 

Amelia

Anastasiia
8 - Asteroid

Hello @AmeliaG, 

 

Thank you for your comment and workflow. 

I am quite new to Alteryx. Can you provide some explanation how this workflow works? I tried to run it and gives error message

The external program "script.bat" returned an error code:1"

 

BR,

Anastasiia 

AmeliaG
Alteryx
Alteryx

Hi @Anastasiia,

 

You are likely getting that error because I did not change the file paths. Please change the file paths in the text input to your file paths. 

 

In the 'Text Input' "Inputs column, please see the below reference for how to update:

Row 1: <Path of Excel Template> "<Directory of New copied File>"

Row 2: <Path of New copied File>

Row 3: <Path of New copied File> <Base File Name>

 

I'll take a look later and see if I can package up into a useful macro. In the meantime, please make the changes to the Text Input. 

 

Let me know how it goes!

 

Amelia

 

Anastasiia
8 - Asteroid

Hello, 

 

The solution is working well if the files are located on a local disc. I have tried with OneDrive and it gives me this error "script.bat returned an error code:1". Might be cause because it doesn't work with OneDrive folders or it has too many spaces in the file path in OneDrive, e.g. "OneDrive - Company name". Otherwise the solution is perfect! Thank you very much! 

 

 

-Anastasiia

AmeliaG
Alteryx
Alteryx

Hi @Anastasiia,

 

For any file or folder path that has spaces, make sure to enclose in quotes. If you add quotes around the file / folder path for the OneDrive assets, does it still give the error?

Labels