Switch Case use in the Tile Configuration Screen
Editing Existing Switch Cases
A case statement returns a value on a specified condition. These are commonly used to split data into separate flows and allow you to provide different configurations or results centred on the value passing through.
This functionality within Rule Designer is called a "Switch Case". If a Rule contains one of more Switch Cases the Tile Configuration Screen will contain a tab where the existing cases can be seen and adjusted.
Each Switch Case contains the values that the Switch Case is looking for in the data and the Output Connector the data will flow to if it contains that value. As the Rule runs and data flows through, where the specified value is found in the data it will flow through to the output selected, thereby switching this data through a chosen flow.
A “Match where field that contains this value” option works as a wildcard looking for the value in the field and switching where it contains it. If more than one value is contained in the data the first value will be used.
New Switch Case pairs can be added. Click on the Add ( Plus) icon and enter the Value and optionally a Target Step name. This will create new outputs for this specific Tile.
Switch Cases added through the Switch Case functionality can be removed. Simply click on delete next to the Switch Case.
Switch cases added can be edited in the screen.
It is possible for more than one Value to be sent to the same Target Step.
Duplicate values are not allowed.
Where the original Template was created with specific Switch Cases built in these cannot be removed or edited in Rule Designer.
Where no default Output was setup for the Switch Case you can select a default here.
Creating New Switch Cases from a Single Field
You can create a new Switch case in Rule Designer from any field. Simply click on the Plus icon against the Tile in Rule Designer. As well as the ability to “Select Template of Connect Tile” you can “Create Switch Case From Field”.
Select a Field to create the switch case from. This will automatically create a Tile called Switch Case ( Fieldname). This can now be edited to add the Switch values and allows you to choose a Default following the same methods as shown above.