Iterate a list view over a data set

About this task

Most list views iterate over a data set and dynamically create a new row in the list for each record in the data set. The most common usage is showing an array of objects that belong to another object. For example, listing all activities that belong to a claim, or all users that belong to a group.

To construct a list view that iterates over a data set, use a row iterator. The structure of this kind of list view is illustrated in the following diagram:



The row iterator specifies the data source for the list. For each record in the data source, the iterator repeats the row (and other elements) defined within it.

Define a row iterator with the Row Iterator PCF element. For example:



The value attribute of the Row Iterator specifies the data source, such as an array of entities or the results of a query. For more information on setting a data source, see Choosing the data source for a list view.

The elementName attribute is the variable name that represents the “current” row in the list. You can use this variable anywhere within the row iterator as the root object that refers to the current row.

Consider the following example, in which a Claim variable represents a claim:



To iterate over the array of activities in the claim, this list view creates a row iterator whose value attribute is Claim.Activities. For each activity in this array, the iterator creates a row with multiple cells. The elementName attribute of the iterator is Activity; it represents the current row, and is used to get the values of the Activity object’s fields in each cell.

This example produces the following list view: