Conditional Attribute Display

As is often the case, an attribute may not be relevant unless another attribute holds a certain value. For example, attributes specific to hazardous materials may become valid if the attribute 'Has Lead' has a value of 'Yes'. To facilitate this, attributes can be conditionally displayed in Web UI and Smartsheets.

A condition can be configured in two ways: as metadata on a description attribute or as a specification attribute link. When configured, it indicates the circumstances under which the relevant attribute is valid.

This enables business users to steer the Web UI and Smartsheets behavior for end users without requiring use of the Web UI designer.

Note: Conditional attribute support does not apply to STEP Workbench as all attribute visibility in the workbench is determined solely by user privileges.

Terminology

For additional context, refer to relevant definitions below:

  • Conditional Attribute - This attribute appears as a metadata field on Description attributes and on Specification attribute links in the Product Hierarchy. Conditional expressions are stored in this attribute.

  • Conditional Expression - Validity rules for the Conditionally Valid Attribute. Expressions are stored in the Conditional Attribute field for the relevant attribute or attribute link.

  • Conditionally Valid Attribute - These attributes are only valid under the conditions specified by a conditional expression. In Web UI, Conditionally Valid Attributes are only displayed to the user when the Conditionally Driving Attribute is populated according to the Conditional Expression.

  • Conditionally Driving Attributes - Attributes that are specified in a conditional expression. Conditionally Valid Attributes rely on populating this attribute with the correct value. In Web UI, Conditionally Driving Attributes are always displayed.

Creating the Conditional Attribute

Before conditions can be set on attributes, the Conditional Attribute must be created.

Note: Only one Conditional Attribute can be active on the system at any given time. To be clear, the Conditional Attribute is the attribute that holds the logic for the Conditionally Valid Attributes. Therefore, any number of Conditionally Valid Attributes and their associated expressions can be configured using a single Conditional Attribute.

  1. In System Setup, navigate to a relevant attribute group and create a Description Attribute with the Base Validation Type of Condition.

  2. Complete any other relevant information and click Finish to create the attribute.

    Important: It is recommended that attributes used for conditional validity (as the Conditional Attribute or as a Conditionally Driving Attribute) do not have dimension dependencies.

  3. Under 'Valid for Link Types', set the validity of the attribute for the Product attribute validation option.

Activating a Conditional Attribute

Once created, the Conditional Attribute must be activated.

  1. Navigate to System Settings and select Users & Groups.

  2. Locate the 'Product Information Manager Default Settings' section.

  3. In the 'Conditional Validity Attribute' field, select the conditional attribute configured in the previous section.

Configuring Conditionally Valid Attributes

Where and how you configure a condition for an attribute depends on whether it is a description or specification attribute.

Description Attributes

The condition for a description attribute is configured as metadata on the attribute itself. Before you can add it to an attribute, however, make the conditional attribute valid for the attribute object type.

  1. In System Setup, navigate to Objects & Structures and expand Basic Object Types, expand Attribute Groups, and then click on Attribute.

  2. In the Valid Attributes section of the Object Type tab, click Add Attribute and browse or select the conditional attribute from the list.

    For more information, refer to the Description Attribute section of the System Setup documentation here.

  3. Navigate to System Setup and select the desired description attribute.

  4. In the Conditional Attribute field, enter the desired condition rules for the conditionally valid attribute.

Specification Attributes

The condition for the Specification Attribute is configured by linking it to the relevant products on the References tab. Before you can add it to a product, however, the Conditional Attribute must be made valid for the Product Attribute Link Type object type.

  1. In System Setup, expand Reference Types and open the Product Attribute Link Type node.

  2. Click Add Attribute and browse or select the Conditional Attribute.

  3. Navigate to the Tree and open the relevant node in the product hierarchy.

  4. On the list of linked attributes, locate the desired Specification Attribute. In Conditional Attribute column, enter the conditional expression.

Writing Conditional Expressions

Conditional expressions are written directly in the STEP Workbench text editor.

The expressions are written in a simple syntax in the format [AttributeID] = [Value1];[Value2], where multiple values act as an 'OR' operator. For example, a Condition Attribute called 'Condition Attribute' specifies that the 'Hazmat' attribute will only appear if the 'HasLead' attribute has a value of true, using the syntax [AttributeID] = [Value1]:

Syntax forms:

  • Any value: *

  • Value list :<value>; <value>

  • Value with a wildcard: val*

Note: A wildcard in the middle of a value is treated as a part of the value, and the leading wildcard is ignored.

Rules that must be observed for the conditions:

  • The used attribute must not have spaces in its ID.

  • The used attribute must not have ':' in its ID.

  • If a value contains ';' it must be escaped with \'

  • If a value contains '\' it must be escaped with \'

Note: Conditional expressions using attributes with LOVs that utilize value IDs will evaluate the value ID. For example, assume a Yes / No LOV exists that uses value IDs, where 1=Yes and 2=No. The conditional expression for this must use the value ID, e.g., 'AttributeA = 1' if the attribute should only be available when the value of AttributeA is 'Yes'.

For more information refer to the Business Rules with Conditional Attributes section of the Business Rules documentation here.

Note: Conditional attributes can also be exported using Smartsheets. When exporting products with conditional attributes any cells containing invalid conditionally displayed values will be automatically locked for editing. In order to unlock the cell and make changes, the user must first fulfill the proper conditions for the attribute and then validate the sheet. For more information on creating Smartsheets exports, refer to the Smartsheet Data and Template Configurations section of the Data Exchange documentation here.

Conditional Attribute Example

A number of Web UI components centered around the Task List and Node Editor components are enabled to deal with the conditional validity of attributes. These components honor the conditional validity settings and only allow for display and/or editing of attribute values if they are valid based on the driving conditions.

For example, the 'Hazmat' attribute is available when 'Has Lead' is set to 'Yes', but is unavailable when 'Has Lead' is left unpopulated or set to 'No'.

Note: The 'Hazmat' attribute is not available if the ‘Has Lead’ attribute is set to ‘No’ or left blank.

Conditional attribute functionality can be used with Web UI elements:

  • ParentValue

  • TargetAttributeColumn

  • TargetAttributeLinkColumn

  • TargetValueHeader

  • Value

  • ValueHeader

  • ValueGroup

  • ValueLinkHeader

  • ValueGroupHeader

  • Attribute Value Component

  • Attribute Value Group Component

Note: Before working on Conditional Attributes, it is important to ensure that attributes have validity and are linked on the object where conditions should match. In our example, 'Has Lead' and 'Hazmat' attributes are linked and have validity on the Item object. If the attribute is linked on the parent level, specify the condition on the parent level. Validity must be available on object.