IF SWITCH node activating both outputs simultaneously

While setting the flow variable to set the output of a IF SWITCH, I end up with both outputs activated, even with a completely separated condition on a previous Rule Engine Variable node. workflow section

Hi @JScheidegger -

It’s hard to suss out what might be going on based on just the screenshot. Are you sure the flow variable from the preceding node is being applied? The IF Switch node does have a “both” option so it’s not unheard of to have both outputs operating.

Maybe upload the workflow itself (or just the relevant portion) if you’re still having trouble?

Hi Scott, thanks for caring. The flow variable from preceding node is defined to be used on the IF configuration Flow Variables . The IF also has been configured with “top” option as well. When running the workflow, neither the “top” or the “bottom” output of the IF Switch go never red crossed, to indicate it is not activated and, as a result, the END IF node collected a duplicated table with twice the due amount of rows. I did configure the END IF to skip duplicated rows, but I am afraid this will always skip the second set (from the “bottom” branch), instead of collecting the proper branch after the IF Switch. I am enclosing snapshots of the configurations, but feel free to ask for more, if you need.

Hi there -

The IF Switch node requires a flow variable with values of “top”, “bottom”, or “both” - as opposed to the “TRUE” and “FALSE” you are generating from your Rule Engine Variable node.

Can you try again with those values and see if it works?

2 Likes

You could alternatively try the ‘IF Switch (Flow variable value)’ node in the Vernalis community contribution, which will let you define the active port directly for simple comparisons on flow variables

Steve

2 Likes

Thanks a lot, ScottF, it did work. Perhaps the node configuration help could make it clearer that those are mandatory words, in lowercase letters, when passing the values by a flow variable. Best Regards!

For exactly this reason, I only use the Case Switch node.
It is my very personal opinion, but I find it a lot easier to use, and it can do everything the if switch does and more :slight_smile:

The case switch is controlled with a variable which must be 0,1,2

3 Likes