Procedure for using the Switch step


The Switch step can direct flowchart execution down a variable number of paths. Path decisions are made based on the evaluation of the logical expression associated with each case. The first true statement will determine the path the Switch step selects. If no case evaluates to true, the flowchart will execute the Default branch.

The following provides a basic methodology for using the Switch step:

  1. Select a value. In the Configuration pane, choose a value from among the inputs, outputs, and variables given. This value will be compared to other values to determine the path the Switch step selects.

  2. Choose an option from the When dropdown list. Select "Value is" for a simple expression, or "Following is true" for a more complex expression. A simple expression will compare the value from step one with a numeric, string or boolean item entered in the Expression textbox. A complex expression is any expression that evaluates to True or False.

  3. Enter an expression. For a simple expression, any numeric, string or boolean item entered will be compared to the value from step one. If they are equal, the Switch step selects this case and the flowchart will continue along this path, otherwise the next case will be evaluated. For a complex expression, you can enter any expression that evaluates to True or False. For example the INRANGE function from the Logic group, of the CONTAINSSTRING function from the String group can be used in the decision.

    Note that double-clicking on the Expression textbox when in "Following is true" mode will open the Advanced editor.

  4. Determine the number of cases required. Click the Add or Remove button to adjust the number of cases the Switch step will evaluate. Repeat steps 1-3 for each case. Note that the Default branch cannot be deleted and will determine the path if no other case evaluates to true.