Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Stop Records from Passing Through a tool without an Error

Datamaster44
5 - Atom

Hello, I created an Alteryx application that has multiple outputs depending on the type of request the users need. As the different requests have different templates and sheets, I have a specific output tool for each request. 

 

I am running into an issue where I need only 1 output tool to have data exporting for a specific request (without the other 5 output tools exporting as well as those are for different requests). 

 

The Message tool does exactly what I need, Stop Records from Passing Through a tool", except it also creates an Error message. This is an issue for an App as a normal user does not need to see an "Error" for this, as I really only need these tools to block the data from continuing to the output tool. Is there any way to Stop Records from Passing Through a tool without an error message occurring?

 

Using a Condition Tool to close the container that houses the output also works, but this seems to require User selection / workflow complexity and I want to avoid adding steps for the user.

 

I have attached an example flow of my current issue.

 

Thank you,

Travis

9 REPLIES 9
gabrielvilella
14 - Magnetar

You can have, for example, a radio button on the interface that the user selects the output file, then this radio button enables only that specific container.

Datamaster44
5 - Atom

The only item a user needs to select in the app is contained in a Tree. Specific reports can only be used for specific clients and I want to ensure a user cannot choose a report that is not correct for their client. I currently have a drop down of 6 request options. But this is a duplicate step, as once the user selects their option from the Tree that is all that is needed.

gabrielvilella
14 - Magnetar

Well, you can use a workaround:

Create a new field with the Null() expression

gabrielvilella_0-1644441762966.png

 

Use this field to append to the file name on the output tool.

gabrielvilella_1-1644441869528.png

 

If there are no records, the file won't be created and no errors will be generated.

 

mceleavey
17 - Castor
17 - Castor

Hi @Datamaster44 ,

 

The only way to do this on an automated basis is to use the record count for your clause to switch containers on or off.

I've built the macro for you as follows:

 

mceleavey_0-1644441954706.png

 

The workflow splits the stream into two, currently those that are "Listing" and those are not. The record count tools count how many records are in each set which are then appended together. These are then fed into the macro as Control Parameter values with the primary data streams feeding into the macro itself. The macro is as follows:

 

mceleavey_1-1644442066073.png

 

Each control parameter is attached to the containers. These are updating the Disable function and will effectively switch on or off each container if the record count is 0. This will result in the macro creating only those reports that have records.

NOTE: You will need to change the destination folder in the output tools, or feed in the dynamic file path as this will output to an external temp folder currently.

 

I hope this helps.

 

M.

 

 



Bulien

Roche
8 - Asteroid

Hi @mceleavey , 

 

I downloaded your solution but for some reason I am not able to run the app with the macro.  It gave a message, after loading it into Alteryx Designer, that the macro will be permanently disabled. 

Roche_0-1664966206536.png

 

I am looking for a similar / same solution for my workflow and hoped to review what you have done in the macro.

 

Please let me know.  Thank you,

Rouche

 

mceleavey
17 - Castor
17 - Castor

Hi @Roche ,

 

I've packaged the macro now so you should be able to install it.

 

M.



Bulien

Roche
8 - Asteroid

Hi @mceleavey , thank you.  Had a look at it, but not sure how I can perform the function that I need.  Can I send you a link of a post on my challenge and ask that you perhaps help me with it?  

mceleavey
17 - Castor
17 - Castor

Hi @Roche ,

 

It's built to do exactly what you posted.

In your example you have two streams, only wone of which will run depending on the value in the "Report" column. Essentially, you want to write out to a file named "Report_Output" when the Report column contains "Disruption", but you don't want the workflow to throw an error on the other stream.

The way I have built it is to put each stream into a container and to de-activate the container which does not match the rule. This way the report will not be created when the condition is not met, and will not return an error.

 

If you want something else then you will need to re-post your new question with an example.

 

I hope this helps,

 

M.



Bulien

Roche
8 - Asteroid

I think I might need something a bit different.  And there is some additional points that I want to mention, so will repost, yes.  Thank you

Labels