Skip to content

Administration - Smart Quote / Product / Attributes

Each Smart Quote product has a number of Attributes. Attributes can be thought of as variables. The Attribute values are "set" either from a user using Smart Quote to select a value (SELECTED), or can be set by a Rule (GENERATED).

This view provides a way to view various properties of all Attributes as a list to make comparison quick and efficient.

List

Valid Values (List) - Queries

Valid Values can be a fixed list. Optionally the valid values can be retrieved from the Items table using a query. The query can retrieve the Number of the Item or any Attribute on a subset of the Items.

Example 1:

<queries>
    <valuesvalid attribute="PANELNUMBER">
        <sql>
            SELECT Number AS PANELNUMBER
            FROM catalog_items
            WHERE
            Category='Panels'
            AND InstanceID=?paramInstanceID
            ORDER BY Number ASC;
        </sql>
    </valuesvalid>
</queries>                

Example 2

This example shows how to use the value of Attributes selected in previous steps of the Configuration process to filter the valid values from the Items catalog.

<queries>
    <comments>
    This query gets the distinct list of MATCOND (for a selected GRD) from the vsmh_materials table
This applies to this Instance only!!!
    </comments>
    <test>
        <attribute name="GRD">17-4</attribute>
    </test>
    <valuesvalid attribute="MATCOND">
        <sql>
          SELECT
          JSON_UNQUOTE(JSON_EXTRACT(AttributesJSON, "$.COND")) AS MATCOND
          FROM catalog_items
          WHERE
          InstanceID=?paramInstanceID
          AND Category='Cut To Length'
          AND ?paramGRD=JSON_UNQUOTE(JSON_EXTRACT(AttributesJSON, "$.GRD"))
          AND JSON_UNQUOTE(JSON_EXTRACT(AttributesJSON, "$.COND")) IS NOT NULL
          GROUP BY MATCOND
          ORDER BY MATCOND
       </sql>
    </valuesvalid>
</queries>