Hello All,
I have multiple different input files with each files own set of logic built, i want to check if file exists or not.
If file1 exists then Process_FILE1_LOGIC else SKIP_FILE1LOGIC
if file2 exists then Process_FILE2_LOGIC else SKIP_FILE2LOGIC
Process common part of workflow every time.
Thanks for your help in advance.
Hi @Akshay_Wadikar ,
Maybe you can try outputting the filename as a field from you Input tool and then use a filter tool which will feed data to different parts of your workflow.
In your filter tool, you can check if the Filename is File1 for example and if that's true it will feed it to the File1 Logic which is connected to the true output anchor of that filter tool.
The same would happen with the records of File 2.
Hope that helps,
Angelos
I am curious about logic what exactly is the logic and how is it defined? and how many files do you have?
You make use of the Alteryx default feature. What Alteryx does is there is an error in a stream in will only stop that specific stream and won't affect other streams. Refer below.
File 1 and File 3 are present hence the stream doesn't have error. And Since file 2 is not present only that stream is stopped.
Hope this helps : )
Hey @atcodedog05 ,
But what happens in case you have 100 xlsx files with the same (or different schema)? It would be troublesome and difficult to maintain to have 100 containers, so you would probably use a wildcard or a batch macro to read all files into a single table. I believe this might be the case here
@atcodedog05 wrote:
I am curious about logic what exactly is the logic and how is it defined? and how many files do you have?
That's totally a valid point. That's why the above was my first question 😅. It depends on how the logic is varying.
Perhaps consider use of Message and Test tools with expressions to either stop the workflow, stop passing records through the anchor(s), etc...
Works great for me. Same logic can be used to check if output files are available and accessible (not open to user or another process)...
Workflow package attached. Extract to C:\temp to demo.
Hi! @atcodedog05 Can you elaborate on the feature of how you can tell the stream to stop if there is an error? Thank you!