Hi everyone,
I have like 30 files of the same format/template and I want to execute each one of them in the same workflow. I created a simple wf just for me to validate that this concept is doable.
I have read about macros however, right now I am struggling to create one.
The goal is to run multiple files in this workflow and create output in xlxs format for each.
Hope someone in the community could assist so I can have a clearer understanding this inquiry.
Thank you
Solved! Go to Solution.
Hi @jogayon001 this article will help depending if the data is exactly the same in terms of columns and schema you might be able use the first two methods otherwise you will need to use a batch macro.
If the files have the exact same format/schema, you can actually just use a wildcard character (*) in your input data tool. You can replace the entire file name or part of it if you want it to find a certain file name.
For example, if you wanted to pull all files in your folder, you can use the following:
C:\Users\jogayon001\Documents\AlteryxWF\Test\*.xlsx
If you wanted to pull all files in your folder that start with the word book, you an use the following:
C:\Users\jogayon001\Documents\AlteryxWF\Test\Book*.xlsx
If the schemas are different, you can build a batch macro with a parameter that changes the input file. The workflow that feeds into this would need to contain the full path of the files you're bringing in. See attached for an example.
Hi echuong1,
Thank you for the response. I tried using the * in the directory. The files that I have are of the same schema. When I executed the wf you shared it stacked the data tables in that directory.
I want to create separate output files per input file.
Regards.
Hi @jogayon001 ,
If you use the wildcard, but output the full path as a field in the input tool then you can use that field to save out separate files in the xlsx format you're wanting. So, even though the data pulls in stacked together it will output separately.
Settings on Input Tool:
Settings on Output Tool:
Hi @kelsey_kincaid,
Thank you for the clarification. Its now clearer to me.
I have one more concern on this sample workflow. So my input data is located in Folder A and I configured my ouput data tool to Folder B. However everytime I run the wf all my input files are overwritten and everything is saved in Folder A. I need the output files in Folder B.
Would you know how to fix?
Here are the config for both tools.
Regards.
Hi @jogayon001 ,
Since you want to save in a different folder, you can get only the filename from your input data tool.
And in your outputdata tool, since you have already configured to save in a different folder, you need only to update the filename, not the entire path.
That way, you will change the filename but not the path where it is saved.
Best,
Fernando Vizcaino
Thank you @fmvizcaino its now working even without the use of macro.
Also thank you to @kelsey_kincaid @echuong1 . You guys are awesome.