Stop node from putting out an error message with a deliberate wrong input

Hi all,

I have created a workflow that overrides the color of certain tags based on a bunch of filters and added a Data shapes section so the user is able to choose wether they want to “add” or remove the color override.

We need to be able to set a color override, but later in the project remove all the overrides.

I have done all of this but i am now running in to the final problem.
If i give the element.type node a wrong input on purpose to stop that part of the workflow from running, i get an error message, obviously…

I would like to be able to remove the error message by another node or remove it by giving it another faux input that doesnt result in an error message…

See below for my graph

image

Edit:

I noticed after writing this that almost all nodes after this one return an output because they cant handle null or a string as input…

Is it possible to “disconnect” a part of a workflow based on the true false logic i created?

Anyone who knows a solution for this problem?

Getting an error in dynamo player is not desired since i can imagine everyone using the script will ask me about an error while they run it…

@MVE1112 Supplying an Empty List works most of the time
image

On a second note, I’m not sure if it’s a good idea to use an if node when you have a mismatch in length of lists (True input has 18 elements vs. False only has “fout”).

I would suggest using something like this instead:

1 Like

Hi AmolShah,

Thanks for your detailed reply!
I used your codeblock as you suggested and this resulted in an empty list input as desired.
I did notice something weird when just entering an empty list in the if node…

When i enter a empty list in as option for the If nodes, it picks the empty list as input, regardless of wether the test is true or false. Just out of curiosity, do you happen to know why this occurs?

The test is True but the output is based on a False test:

1 Like

@MVE1112 Glad that it worked out for you.

I’m aware of that issue and that’s the reason I suggested the alternative using a GetItemAtIndex approach.
I don’t remember why it does that on top of my head but it has been discussed on forum quite a few times. So dig into it if you are curious!

1 Like