Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
SOLVED

Using test tool to stop workflow example

Highlighted
Asteroid

Hi,

 

I have looked everywhere but couldn't find a post about my specific problem (or even similar examples for this tool). 

 

I am trying to use the "Test" tool to stop my workflow based on a specific condition. Basically I am joining two tables and if rows from the right table don't match with the master table (on the left input), then I would like the workflow to stop working.

 

I have tried adding the "Test" tool with the test type "Expression is True for All Records" and setting the test Value to [Field] != "Null" (the field names are strings, it is okay if it kicks out a blank one, or therefore Null, but it cannot include an actual word or even letter). When I test this workflow (and put in a wrong name that won't match on purpose) it does not give me an error.

 

Basically I have one master table on the left which includes project names (let's say: Admin, Other, Training) and then another table where people put in project names (they can include all or part of the ones from the master table). However, I want the workflow to stop working if someone accidentally typed "Ad" instead of "Admin". How can I do this?

 

Can anyone help me with this, I am running out of ideas?

 

Thank you,

 

VCapture.PNG

Highlighted
ACE Emeritus
ACE Emeritus

Hi,

 

Try changing [Field] != "Null" to [Field] != NULL().

 

You're currently comparing against the text string Null, not actual NULL values.

 

Hope this helps!

Highlighted
Asteroid

Hi,

 

Thank you so much for your fast reply!

 

Your answer makes sense and I changed it but it still doesn't give me an error even though I have the "Ad" string in there which should activate the error.

 

Any other suggestions on how to make it work?

 

Thanks,

V

Highlighted
ACE Emeritus
ACE Emeritus

Remove the "!" sign - what your test is currently doing is saying "I expect that all values presented to me will not be Null" - so when you feed in text, it passes.


Didn't notice the reverse in logic the first time I looked at your function!

Highlighted
Asteroid

Thank you! That makes way more sense now.

 

I changed it but then it gave me errors even when there where blank records but I realized it was because I had a mix between Null and Empty records so when I included a formula that forces them all to be either Null or Text, it worked.

 

Thank you so much for your quick help!

Highlighted
Asteroid

Sorry for the follow up question (and if this is not allowed, I am more than happy to start a new post) but I thought since it is about the same tool and the same workflow, I will add it here.

 

I got the test tool to work (the way I want it) but it does not  stop the workflow early enough. For some reason (even though I have a "Block until done" tool), it still goes through with the rest of the workflow and outputs data when it finds an error.

 

Could you tell me why? I basically want it to look at this first and if there is no error, THEN continue on with the rest.

 

See below for the workflow part that is affected:

 

Capture.PNG

 

 

 

 

 

 

 

 

 

 

Thank you,

V

Highlighted
ACE Emeritus
ACE Emeritus

There's a setting in the Workflow - configuration pane (the space where you configure tools if you don't have a tool selected) under Runtime that is "Cancel Running Workflow on Error".  If you check this box off it will end the process if you encounter ANY error, so the rest of your layout will work!
CancelFlow.PNG
There are some more advanced options if you only want specific errors to prevent output/running of the flow, but this should probably do what you need.

 

RE: Follow up questions - you can mark multiple solutions in a single post, and while general etiquette here is to open a new post for new questions, this is directly related to your initial topic and within a short enough period of time that you're probably fine.  My rough guideline would be that if you're asking a question about a new topic, or it has been a day since you marked a post as Solved, you are better off making a new post.

You may also find that in some cases the poster who solved the first piece doesn't know an answer to the second, or isn't available to help.  Solved posts usually get less traffic from people looking to help in the Community, so if you reply quickly after a Solution is marked with another question and don't get an answer in a day or so, you may be better off making a new post with that detail.  You can even link back to the original thread in that new post for ease of use!

 

Highlighted
Asteroid

Thank you so much for the reply!

 

This worked for me!

 

Have a great weekend :)

Highlighted
Alteryx Partner

Even when I have that option checked to disable workflow on error, if the process is fast enough the output is still written:

 

alexandramannerings_0-1574188558696.png

Labels