Home > Contents > Index >  
Template Tag TOC  |   Alpha TOC  |   Tag Family TOC  |   Purpose TOC  |   Annotated TOC  |   Index 

 

ASSETSET.GETMULTIPLEVALUES

Scatters attribute values from several attributes (and potentially more than one product) into several specified lists. This tag executes a single SQL query in order to perform its function. (It is therefore much more efficient than using ASSETSET.GETATTRIBUTEVALUES repeatedly for multiple attribute values.)

Syntax

Parameters

name (required)
Input parameter. Name of the assetset object.

list (required, if assetset.sortlistentry not used)
Input parameter (see as output, below). List of attribute names to scatter. This list has three columns:

byasset (optional)
Input parameter. Boolean value indicating whether to scatter a different instance of each attribute for each individual asset in the assetset (true), or to group all the attribute values for all assets together into one list per attribute (false). The default is false.

immediateonly (optional)
Input parameter. Boolean value indicating whether to scatter inherited attribute values or not. A false value indicates that inherited values should be scattered (the default).

prefix (required)
Input parameter. Starting part of the list names that this method creates.

Description

If byasset is false, creates a set of lists with the names: prefix:attrname. If byasset is true, creates a set of lists with the names: prefix:assetid:attrname.

This tag is highly efficient in that it executes a single query to retrieve all values. We therefore recommend using this tag wherever possible instead of multiple instances of assetset:getattributevalues.

We recommend using assetset:getmultiplevalues when the goal is to display a fixed-format table of assets, or to obtain many attributes of a single asset (such as for a product detail page).

assetset:getmultiplevalues has the following limitations:

NOTE: This tag also causes dependencies to be recorded for all assets that contribute to the returned lists, or if this assetset object is not an enumerated one, then the equivalent of RENDER.UNKNOWNDEPS will be performed.

Example

This example reads two attribute values from the assetset object myassetset, "FSIIPrice" and "FSIISKU". If the BYASSET attribute is not specified, the result will be two lists, one for each attribute: ValueList:FSIIPrice and ValueList:FSIISKU.

<!-- Associate the blank searchstate with a new asset set. -->
<SEARCHSTATE.CREATE NAME="ss"/>
<ASSETSET.SETSEARCHEDASSETS NAME="myassetset" CONSTRAINT="ss" ASSETTYPES="Product_C"/>

<LISTOBJECT.CREATE NAME="mylistobject" COLUMNS="attributetypename,attributename,direction"/>

<LISTOBJECT.ADDROW NAME="mylistobject"
    attributetypename="Product_A"
    attributename="FSIIPrice"
    direction="descending"/>
<LISTOBJECT.ADDROW NAME="mylistobject"
    attributetypename="Product_A"
    attributename="FSIISKU"
    direction="ascending"/>
<LISTOBJECT.TOLIST NAME="mylistobject" LISTVARNAME="listout"/>

<!-- Make sure the output lists are precreated and are empty, in case there are no values -->
<LISTOBJECT.CREATE NAME="mylistobject" COLUMNS="value"/>
<LISTOBJECT.TOLIST NAME="mylistobject" LISTVARNAME="ValueList:FSIIPrice"/>
<LISTOBJECT.TOLIST NAME="mylistobject" LISTVARNAME="ValueList:FSIISKU"/>
<!-- Apply the sort list to an assetset and create output lists, where data exists -->
<ASSETSET.GETMULTIPLEVALUES NAME="myassetset" PREFIX="ValueList" LIST="listout" IMMEDIATEONLY="false"/>
<!-- Display list -->
<LOOP LIST="ValueList:FSIIPrice">
<ICS.LISTGET LISTNAME="ValueList:FSIIPrice" FIELDNAME="value"/><br/>
</LOOP>
<LOOP LIST="ValueList:FSIISKU">
<ICS.LISTGET LISTNAME="ValueList:FSIISKU" FIELDNAME="value"/><br/>
</LOOP>

Alternately, you may use the sortlistentry argument.

<ASSETSET.GETMULTIPLEVALUES NAME="myassetset" PREFIX="ValueList" IMMEDIATEONLY="false">
    <ASSETSET.SORTLISTENTRY attributetypename="Product_A" attributename="FSIIPrice"/>
    <ASSETSET.SORTLISTENTRY attributetypename="Product_A" attributename="FSIISKU" DIRECTION="ascending"/>
</ASSETSET.GETMULTIPLEVALUES>
<!-- Display list -->
<LOOP LIST="ValueList:FSIIPrice">
<ICS.LISTGET LISTNAME="ValueList:FSIIPrice" FIELDNAME="value"/><br/>
</LOOP>
<LOOP LIST="ValueList:FSIISKU">
<ICS.LISTGET LISTNAME="ValueList:FSIISKU" FIELDNAME="value"/><br/>
</LOOP>

The following example shows the use of BYASSET:

<ASSETSET.GETMULTIPLEVALUES NAME="myassetset" PREFIX="vlist" IMMEDIATEONLY="false" BYASSET="true"> <ASSETSET.SORTLISTENTRY attributetypename="Product_A" attributename="FSIIPrice"/> <ASSETSET.SORTLISTENTRY attributetypename="Product_A" attributename="FSIISKU" DIRECTION="ascending"/> </ASSETSET.GETMULTIPLEVALUES> <!-- Display results --> <ASSETSET.GETASSETLIST NAME="myassetset" LISTVARNAME="aslist"/> <LOOP LIST="aslist"> <ICS.LISTGET LISTNAME="aslist" FIELDNAME="assetid" output="theid"/> <ICS.LISTGET LISTNAME="vlist:Variables.theid:FSIIPrice" FIELDNAME="value" /><br/> <ICS.LISTGET LISTNAME="vlist:Variables.theid:FSIISKU" FIELDNAME="value" /><br/> </LOOP>

See Also

ASSETSET.SORTLISTENTRY

ASSETSET.GETATTRIBUTEVALUES
LISTOBJECT.CREATE
LISTOBJECT.ADDROW
LISTOBJECT.TOLIST