Hi,
I have been working on a workflow that has 5 inputs. The first 4 inputs are standard inputs and will be used in all scenarios but the last input cannot be used in some cases. I want this input to run on a condition.
Condition: I have also used a Count Records tool to form the condition, that is, if the value in Count Records tool is 5 then only run the 5th input file else run the first 4 inputs only.
Now, I'm stuck on how do I connect this condition with the (dynamic) input.
Solved! Go to Solution.
I believe you'll have to create a batch macro. the value from your Count Records tool would feed into your control parameter. there's probably various ways to use the value from the CP, but best way - IMO - is to have it update a Detour tool.
Using a filter tool won't work because the Dynamic Input tool will still run. A Detour tool, however, completely disables tools that the data stream is detoured away from.
Hi @jrgo,
I'm pretty much new to Alteryx. I'm not sure how to make a Batch Macro on a dynamic input file and likewise, I don't know how the Detour Tool works.
Since the files that I'm working on are very confidential, so should I send a dummy workflow, so that I can get a better understanding?
Feel free to send some dummy data if you'd like, but I won't be able to put together a solution for you anytime soon, but someone else may be able to.
There's quite a bit of training videos available in Academy that reviews Macros and, more specifically, Batch Macros. The Detour tool is pretty straight forward and is used with the "Detour End" tool. If you click on a either (found in the Developer tool category), there is a tool example you can look at.
Could add only 5 files in the last comment, here are the last 2 files.
@jrgo, if you could help me in tagging some people you may know who could help me in this, since I was hoping for a solution at the earliest.
I went with two batch macros. The first didn't pass the empty file through the first time, but it's a good check in case it ever does.
The Workflow:
The directory is linked to a folder with those five files.
The first Batch Macro:
This essentially outputs a single record of FullFilePath and CountRecords. The Macro outputs a union of all five files in the original workflow.
The second Batch Macro:
As straight forward as that gets where only files with record counts >0 are fed into it!
Hey, @DylanDowrick.
Thank you for replying, can you send me the workflow so that I can test it with more data?
Also, will this macro work with a Dynamic Input tool?