You are here: Configuration > Rules > Using Arrays in Simple Configuration Rules

Using Arrays in Simple Configuration Rules

OVERVIEW

When rules are using arrays, they will operate on each index, as if each index is a separate rule. The rules are essentially breaking up array sets and treating them like individual attributes. When using rules to evaluate each row in the array, keep in mind:

ClosedExample


ADMINISTRATION

ClosedRule Behavior Scenarios


USE CASES

ClosedUsing Array Attributes in a Constraint Rule Condition that only allows certain values in the Action

In this use case, we'll be demonstrating how to use array attributes in the condition of a constraint rule that will only allow certain array attribute values in the action. This article assume you know how to navigate to constraint, hiding, and /or recommendation rules.

  1. Enter the rule Properties.
  2. Select a Condition Type. For this example, we'll select Simple Condition.
  3. Use the drop-down under Attributes to choose your first condition (array-type) attributes.
    1. An array attribute must be used in the condition in order to use an array attribute, in a simple way, in the action. In addition, only array attributes that share a control attribute can be used when a simple condition contains an array attribute.
  4. Choose the Operator from the drop-down.
  5. Select the Value Type:
    • Attribute: Compare one attribute to another in a single condition row.

      The attribute data type must be equal for the comparison. Also, when comparing an array attribute to a non-array attribute, the array attribute must be specified on the left side of the operator.

    • Static: Enter a static value in the Values column.

ClosedExample

  1. Set Row Grouping.
  2. Select to apply the rule to Configuration, Selection or Both. In this example, we've selected Configuration.
  3. Select an Action Type: Standard or Table Based. In this example, we've selected Standard.
  4. Enter Action Attributes by clicking Add Attribute.

    The Action Attributes dialog box appears.

  5. Select configurable (array-type) attribute(s) and click Add Attributes. In this example, we've selected array attributes Dessert Size and Dessert Flavor.

  6. Click on an individual attribute name. Notice that in doing so, the attribute values to constraint/allow, hide or set (based on rule type) will change as you select different attributes.
  7. Set the values (these options change based on rule type):

    Constraints
    (Values to Constrain/Allow)
    Recommendations
    (Values to Set)
    Hiding Rules (Values to Hide)
    Constraint All: Select checkbox to constrain all values for the array attribute. Select Values: Use drop-down to choose which array values to set. Will hide attributes based on conditions.
    Select Values: Use drop-down to choose which array values to constraint. Set Type: Choose from None, Set and Force Set.  
    Constrain Behavior: Choose from "Do not allow selected values" or "Only allow selected values"     
  8. Create Message to Display on User Side.
  9. Click Save.

NOTES

RELATED TOPICS

Related Topics Link IconSee Also