Alteryx Designer Desktop Discussions

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

How to by pass part of workflow if File does not exists

Akshay_Wadikar
5 - Atom

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.

7 REPLIES 7
AngelosPachis
16 - Nebula

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

atcodedog05
22 - Nova
22 - Nova

Hi @Akshay_Wadikar 

 

I am curious about logic what exactly is the logic and how is it defined? and how many files do you have?

atcodedog05
22 - Nova
22 - Nova

Hi @Akshay_Wadikar 

 

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.

atcodedog05_1-1631775557120.png

 

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 : )

 

AngelosPachis
16 - Nebula

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
22 - Nova
22 - Nova

Hi @AngelosPachis 

 


@atcodedog05 wrote:

Hi @Akshay_Wadikar 

 

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.

HomesickSurfer
12 - Quasar

Hi @Akshay_Wadikar 

 

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.

 

Capture.PNG

tungduong4920
5 - Atom

 Hi!  @atcodedog05 Can you elaborate on the feature of how you can tell the stream to stop if there is an error? Thank you!

Labels