@list

Use the <@list> tag to build data tables.

You can use data tables in email messages to display multiple rows of information that is retrieved from one or more dimension tables in Campaign.

In the <@list> tag, you specify fields in the dimension table that contain the information that you want to appear in the list. For each email message, the <@list> tag iterates through the dimension table that you specify and selects only those rows that contain information that is applicable to the email recipient. You can specify a sort order for the results, limit the number of rows that display, and use the script logic and operators to control the organization of rows and cells in the table.

You can write scripts that use the <@list> tab to display the tag output in various formats, including tables and comma-separated lists.

Use the following syntax.

<@list dimension= "dimension table name" sortBy= "display name:data type:sort order" 
maxRows= number; loop variable> </@list>

The syntax for specifying a personalization field as a cell value is ${<loop variable>.<display name>}

The following example illustrates how to use the list tag to create a table that presents list of the 10 largest purchases, with the largest purchase listed first.

<table>
<@list dimension= "CustomerTransactions" 
sortBy= "purchaseAmt:numerical:descending" maxRows= 10; row>
<tr><td>${row.PurchaseDate}</td><td>${row.PurchaseAmount}</td></tr>
</@list>
</table>

The following sections describe the elements that are used to create the table.

dimension

The name of the dimension table in Campaign that provides the values that display in the data table. The name must appear in quotation marks.

Note: Scripts in Deliver do not support smart quotation marks.

sortBy

sortBy= "display name:data type:sort order"

Specifies how data table values are listed.

display name

Value: The display name of the personalization field that is mapped to the dimension table field that is used to define the sort order. Enter the display name as it is defined in the Deliver process that is used to build the OLT that you use with the document.

For example, to retrieve all instances where the customer returned merchandise, sort the dimension table with the field for return authorization numbers.

data type

Value: numeric | string

The data type for the dimension table field that is used to sort the data. The data type is specified in the Type field of the Output tab of the Deliver process that is used to define the OLT. You can change the data type from the Deliver Personalization Fields page, that you access from the Deliver Settings page.

sort order

Value: ascending | descending

The order in which you want the data to appear.

For example, a list of sequential transaction IDs listed in descending order displays the most recent transaction as the first item in the table.

maxRows

maxRows=number

Limits the number of rows that display in the data table. Enter the number of rows that you want to appear in the table.

loop variable

When you run an advanced script, Deliver uses the loop variable as it steps through the dimension table. The value of the loop variable increments each time that the script completes an iteration through the dimension table. You must specify the loop variable when you include a personalization field in the data table output.

You can specify any name for the loop variable.