Data Management Capabilities > Managing Part Structures > Examples and Best Practices for Advanced Selection Logic > Common Logic Expressions > Simple If/Then Expressions Using Case Tables
  
Simple If/Then Expressions Using Case Tables
One of the most common logic expressions is the If/Then statement. For example, you might want to ask the user to select a color for the exterior of a product and then automatically select a complimentary interior color. A case table is a set of conditions arranged in rows where each row represents a single If/Then expression.
To use a simple conditional expression using case table:
1. Create a configurable module.
2. Define a string input parameter. For example, askExteriorColor.
Establish a prompt expression, for example, “Select the desired exterior color”.
Establish the valid exterior color values for this parameter’s constraint using values such as:
Red
White
Blue
3. Define a second non-input string parameter. For example, interiorColor.
Establish the valid interior color values for this parameter’s constraint using values such as:
Pink
Grey
Green
4. Define a case table, for example, pickInteriorColor, to automatically select the interior color based on the user’s exterior color selection such as:
Add both parameters, askExteriorColor and interiorColor, to the case table.
Ensure that the case table contains the following values:
askExterior
interiorColor
Red
Pink
White
Grey
Blue
Green
In this case, once the user selects the first parameter askExteriorColor the system automatically assigns the second parameter interiorColor the value from the case table. In essence, each row of the case table represents a simple If/Then statement, such as:
If askExteriorColor = Red, then interiorColor = Pink