Start Free Trial

Alteryx Designer Desktop Discussions

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

Running macros conditionally

Biswarun
8 - Asteroid

My workflow contains two macros - one for processing csv files and another for xlsx files. I am picking files of the two kind via directory tools and filtering them to the two macros. Both the macros have an output column which is union-ed and stored.

 

The workflow works all fine unless it happens that there is not a single xlsx file OR not a single csv file OR not a single file of either kind. In such cases, the corresponding macro(s) error out. How to solve this?

2 REPLIES 2
Emmanuel_G
13 - Pulsar

@Biswarun 

 

To avoid errors, you can you use detour tools according to the logic shown below.

 

Let me know if there is any issue after the test in your workflow. 🙂

 

Emmanuel_G_0-1664277674607.png

 

 

 

Felipe_Ribeir0
16 - Nebula

Hi @Biswarun 

 

It is a possibility for you to always keep a .xlsx just with the headers on one directory and one .csv just with the headers on the another?

 

I would consider doing this, it is simple but functional :).

Labels
Top Solution Authors