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

How to include a standard instruction sheet in all output files .

simasarry123
8 - Asteroid

I have a workflow that uses render tool to generate multiple output files depending on a certain condition being met. The number of output files would vary month on month depending on the data in the input file. I need one standard instruction tab (template) to get added to each of the output file that gets generated. Sample of one such file is attached. So if there are 10 files, all 10 should have the instructions tab.

 

Any suggestions?

7 REPLIES 7
FilipR
11 - Bolide

1. You need your template with the Instructions and Overview tabs saved somewhere (a Shared Drive preferably, so that Alteryx Gallery has access to it as well).

2. Download the Alteryx SDK tool "File Copy and Move" from Github: https://github.com/bobpeers/Alteryx_SDK_FileCopyMove

3. Modify the attached workflow to fit your requirements (this part creates the number of reports you need):

FilipR_0-1656665666365.png

 

4. Then you have to add a macro that will update the created files. Here's a working example:

FilipR_0-1656671706545.png

 

simasarry123
8 - Asteroid

Thank you for the solution. It works but the issue is it is also removing the formattings that were present in my output sheet generated from Render. Is there any workaround so that my existing file formatting does not change . Also, what do I enter in the first input tool that says no. of copies ?

FilipR
11 - Bolide

@simasarry123

 

1. Fixed the formatting issue in the macro. Please see attached. Remember to delete all rows in your template except for the header row (delete rows, not cells!) and make sure your output always has the same columns as your template.

 

2. As for the "Copies Needed" input tool - you replace it with your own calculation. This tool and the one described as "Sample data" are placeholders. From what you described your workflow already shows you how many files you will need.

 

Please remember to mark my post as a solution.

simasarry123
8 - Asteroid

Thank you Filip for your help so far. Sorry for the late reply . I was trying to figure this out on my own. The workflow is running fine . I am not sure if I explained it correctly. The workflow is creating copies and then combining the render output tab to these copies instead of vice versa. I want the instructions sheet to move into Render output file , but instead it is moving render output  inside the template copy due to which I am losing the original file name also . Please see attached screenshot

 

1) copies of instructions files with data from render tool created - snip 1 

2) eg - of the output file . Also is it possible to remove the ReportID column from the output .

3) The path where render output is saved, each has a different name. The need is to move the instructions tab to these file but instead it is moving this file into instructions file. 

 

 

 

 

FilipR
11 - Bolide

@simasarry123 

Making the files beforehand and just appending the Overview tab is the preferred solution, really. Otherwise you'll have to program the entire output tool in Python from scratch.

 

If you have an indication of what the file names should be in your input, I can modify the workflow to make the new files with the names you need (instead of adding "-copy1"). Something like this:

 

FilipR_0-1657696910565.png

 

simasarry123
8 - Asteroid

Hi Filip, unfortunately the file name is variable and picks up from the field in the input file so we cannot determine the name in advance.

FilipR
11 - Bolide

@simasarry123 the name can be absolutely variable. You probably construct it somehow in your workflow already in order to save the files (unless you are renaming the files manually every time, which you definitely shouldn't be doing).

Labels