This workflow demonstrates the usage of the "Case Switch Data" node. Same principles applies for 'CASE Switch Model' and 'CASE Switch Variable'.
This is a companion discussion topic for the original entry at https://kni.me/w/_cHGyAPEClgQNXC3
This workflow demonstrates the usage of the "Case Switch Data" node. Same principles applies for 'CASE Switch Model' and 'CASE Switch Variable'.
Hello my friends, how are you?
Today I came across a situation where I needed to have more than one option to direct my flows. The Switch Case option would be the answer, but looking at other posts in the communication and in online searches, many cases stopped or did some tricks to be able to indicate more than one direction.
I don’t know if it’s a program update, but Case Switch Start (Switch) offers the output for multiple ports, where you have to right-click and add the outputs.
Another important point, it is possible to work with variables, so if you define data for pre-selection and targeting by an integer from 0 to N positions, it would be enough to indicate this in the component configuration for it to know how to classify the data. From the images below, you will see what I mean and I hope it will be as helpful to everyone as it has been to me.
I do this as a way of giving back to what this community has offered and I strongly believe that my contributions can do the same.
Thank you all!
Nice contribution! Indeed, the increased number for Case Switches is a feature that was introduced in V.4.5.2
Thanks… but it’s not to easy to find the information about it clearly… most information have old content… I just bring the new vision and a case to use to be easier for everyone like was to me now.
Tks Arjen!
Hi!!! See this workflow attached.
case.knwf (32.9 KB)
I add an example using a “data table” with some information and set which port I’d like to put the flow as “Switch” name.
I used the chuck loop start just to use 1 row for execution because the flow will set for the last or the first information as variable.
In this case, each row will set the variable to be tested and a “rule variable”.
As the image above, I made a test to set the port as I wish… You can change the information as you wish. The information was put at a new variable called “prediction”, and I"ll use it to set the switch variables.
I add 3 port outputs because I’ve 3 option to swtich, it could be more or less as you wish.
After that, I add 3 simple situation to change the text that a set at the inicial data table as you can see on the first image above. I just join some strings to the information to change something, but could bem more complex here as you imagine or need and put at the same field to register this changes.
For the Switch Ends, don’t forget to merge the information IF you manipulate de data and will join all together.
Sometimes you need to generate new IDs for the transformation, and the end of the process, at the Switch ends, you’ll set it.
So, look the start and the end of this process:
Start
End
Each one have new information for column “texto”…
Well, thats it!
Thanks all!