The function ecx:filter searches a column of data for a specific value and returns matching entries. The value returned is an object type.

Example

The related data set ​Purchases is linked to the attribute CustomerID. The data sets saved with the key CustomerID are not unique, as one customer can purchase multiple items. In the related data set, the name of the purchased article is saved in the column ​Articles, according to the key.

A message sent to the customer displays all articles purchased on or after 05 July 2011. Because a single customer can have purchased multiple items, the information is inserted into the message using a ​ForEach​ loop:

<%ForEach var="count" items="${ecx:filter(user.relatedAttribute['Purchases'], 'Date', '<=','2011-07-05')}"%> <%${count.Article}%> <%/ForEach%>
CODE

Structure​

ecx:filter(object, string, string, string)

Parameters​

Parameter

Description

object

Specifies the location of the data to filter.

string

Specifies the column to search.

string

The operator used for the filter (for a complete list, see ​Operators​). If the operator used is not compatible with the data type of the searched column, an empty result is returned.

string

The value to be used to query the column.