The Alteryx Community is a finalist in three 2026 CMX Awards! Help us win Customer Support Community, Most Engaged Community, and User Group Program of the Year - vote now! (it only takes about 2 minutes) before January 9.
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

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

How to create a Macro to input new data from Input files into output template

kauser
8 - Asteroid

Hello, 

 I am currently working on a workflow where the input file needs to be updated more frequently. The challenge I'm facing is figuring out how to upload new data without modifying the workflow. Additionally, the new data needs to be mapped into a new tab in the output file. To help illustrate this, I've included two figures below.

 

Figure 1: Current Input file- 

 

Item ColorGroup Amount 
AGreen I50
DBlueII60
BBlack IIII75
CWhite III80

 

Figure: Same input with new data (last two rows) 

Item ColorGroup Amount 
AGreen I50
DBlueII60
BBlack IIII75
CWhite III80
FOrangeIIIII55
GRedIV45

Now how can i add Item F, G into new tab in the existing output file. 

4 REPLIES 4
jrlindem
12 - Quasar

@kauser  

So long as you have a defined output file, knowing its location, you can add new data or tabs into that file (provided the file is not open or in use by someone at that moment).

I would take you input data and join that back to the data from Tab 1, 2, 3, 4, etc using the Item field.  You're doing this so that you can figure out if and what the new rows of data are.  Once you have those, then you'll know if you need the new tab.

I would probably use a formula tool to identify the same original output file and then just write the records back to that file using a full filepath.name|||sheet replacement.

 

If the workflow still has the original excel file open (which is likely the case) then you can always write the entire file again as a copy, append the new tab, and then go back using Run Command to remove the original file.  Alternatively, could probably use the BLOB tool here too.

 

I don’t think you need a macro though.  I mean to say, you could, but I don’t think it’s necessary.

 

Hopefully this makes sense…  -Jay

WirkKarl
8 - Asteroid

If your input file changes frequently and you don’t want to modify the workflow each time, the easiest option is to build a Batch Macro. The macro can read whatever new rows appear in the input and then route only the “new” items (F, G, etc.) into a separate output stream.

kauser
8 - Asteroid

@wirb 

yes i agree and that's what i am looking for. can you please share workflow with batch macro that i can learn form. 

 

thank you 

wirb
5 - Atom

I'm sorry I don't have the solution and not sure how to tag the one above that I think you were trying to get.  @wirkKarl

Labels
Top Solution Authors