Question regarding Switches or Variable Inputs

I am not sure if switches is the appropriate solution to what I am attempting to do. I have a workflow that contains 3 reports with Report 1 staying consistent and then depending on the task, would join it with Report 2 or Report 3 using Joiner. From there, there are a lot of subsequent steps that are all the same beginning with the Extract Date & Time Field node. Currently, I have it set up so that if I am using Report 2 then Report 3 file would not be in the folder and if I am using Report 3 then Report 2 would not be in the folder - resulting in an execute failed for whichever one is missing. I want the workflow to switch between joining Report 1 & 2 or joining Report 1 & 3 depending on which one was able to execute and then continue on to the next nodes. I have been reading about switches but those seem to be more for outputs than inputs.

Hi @eckers85 , switches don’t really have anything with input or output. You can think of them as routers that allows you to route your workflow through different paths, based on some conditions.

And IF Switch can work for what you are trying to do, but alternatively you can also read the second file dynamically, controlled by a variable, that way you do not need to set up 2 joins, that is as long as Report 2 and 3 have the same structure. If their structures are different, then you may need to use the IF Switch for this, as it will allow you to have 2 sets of processes.

It will, of course, also depend on what you do after the join. Are the processes the same after the join of the either table?

1 Like

@bruno29a The layout of each report is different so they require different nodes to format them into the correct layout before they get to the joiner. After the joiner, the processes are the same for both.

Hi @eckers85 , in this case you should use the IF Switch as it will allow your to have different nodes per route.

1 Like