---
schema_version: "1"
id: b5a5c438f98d2cd00dbb462d416f388eb1709650073bd5cadb53f6cd08d563e1
title: FlatList Class
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/retail_api/apex_class_CGCloud_RTRReportResult_FlatList.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.retail_api.meta/retail_api/apex_class_CGCloud_RTRReportResult_FlatList.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: bdbeeb8090bda9bd4e6350e1c1943cd7a5e93b5338d67bad65e54de8269a1826
description: Represents a Real Time Reporting (RTR) report UI Flatlist component. This class extends the ReportComponent class. Returns an instance of a FlatlistRowIterable object with all the rows contained in the Flatlist. Returns an instance of a FlatlistRowIterable object with all the rows that match the specified row type filter. The available values for the row type filter can be extracted with the getRowTypes method. Returns a set that includes all the available column names in the Flatlist. Returns all the available row type filters present in the Flatlist. The row type filters can be used to filter the dataset.
---
# FlatList Class

Represents a Real Time Reporting (RTR) report UI Flatlist component. This class extends the ReportComponent class.

## Namespace

[CGCloud](https://developer.salesforce.com/docs/atlas.en-us.retail_api.meta/retail_api/apex_namespace_CGCloud.htm "The CGCloud namespace provides classes that allow you to customise Real Time Reporting (RTR) data extraction from Apex.")

## Usage

The RTRReportResult.FlatList class is used to access Flatlist information from RTR reports.

## Example

Here’s an example of how to extract the Flatlist data from the RTRReportResult object.

// Extract the Flatlist from the result
// - The component name must match its 'uimapping' name
// - The result must be casted to the correct type.
cgcloud.RTRReportResult.Flatlist flatlist = (cgcloud.RTRReportResult.Flatlist) 
    reportResult.getComponent('FlatList');
    
// Retrieve the rows Iterable object
// All rows can be retrieved with the parameter-less "getRows"
cgcloud.RTRReportResult.FlatlistRowIterable iterator = flatlist.getRows('Promo-Product');

// Iterate over all the rows
while (iterator.hasNext()) {
    cgcloud.RTRReportResult.FlatlistRow row = iterator.next();
    
    // Extract column data. We assume the specified columns are in the report
    
    // Dimension information can be extracted with <dimension name>.<field>
    String promotionId = String.valueOf(row.getColumnValue('promotiondimension.id'));
    // KPI Value information can be extracted by querying the KPI Name
    Decimal kpiValue = (Decimal) row.getColumnValue('ProPlanIncrVolume');
    
    system.debug('Values: ' + promotionId + ' ' + kpiValue);
}

- **[FlatList Methods](https://developer.salesforce.com/docs/atlas.en-us.retail_api.meta/retail_api/apex_class_CGCloud_RTRReportResult_FlatList.htm#apex_CGCloud_FlatList_methods)**

## FlatList Methods

The following are methods for FlatList.

- **[getRows()](https://developer.salesforce.com/docs/atlas.en-us.retail_api.meta/retail_api/apex_class_CGCloud_RTRReportResult_FlatList.htm#apex_CGReporting_getRows)**  
    Returns an instance of a FlatlistRowIterable object with all the rows contained in the Flatlist.
- **[getRows(String rowTypeFilter)](https://developer.salesforce.com/docs/atlas.en-us.retail_api.meta/retail_api/apex_class_CGCloud_RTRReportResult_FlatList.htm#apex_CGReporting_getRows_1)**  
    Returns an instance of a FlatlistRowIterable object with all the rows that match the specified row type filter. The available values for the row type filter can be extracted with the getRowTypes method.
- **[getColumns()](https://developer.salesforce.com/docs/atlas.en-us.retail_api.meta/retail_api/apex_class_CGCloud_RTRReportResult_FlatList.htm#apex_CGReporting_getColumns)**  
    Returns a set that includes all the available column names in the Flatlist.
- **[getRowTypes()](https://developer.salesforce.com/docs/atlas.en-us.retail_api.meta/retail_api/apex_class_CGCloud_RTRReportResult_FlatList.htm#apex_CGReporting_getRowTypes)**  
    Returns all the available row type filters present in the Flatlist. The row type filters can be used to filter the dataset.

### getRows()

Returns an instance of a FlatlistRowIterable object with all the rows contained in the Flatlist.

#### Signature

static RTRReportResult.FlatList getRows()

#### Return Value

Type:[FlatlistRowIterable](https://developer.salesforce.com/docs/atlas.en-us.retail_api.meta/retail_api/apex_class_CGCloud_RTRReportResult_FlatListRowIterable.htm#apex_class_CGReporting_RTRReportResult_FlatListRowIterable "Represents a Real Time Reporting (RTR) report UI Flatlist component set of rows. This class implements the Iterable interface that allows it to be used in batch processes.")

### getRows(String rowTypeFilter)

Returns an instance of a FlatlistRowIterable object with all the rows that match the specified row type filter. The available values for the row type filter can be extracted with the getRowTypes method.

#### Signature

static RTRReportResult.FlatList getRows(String rowTypeFilter)

#### Parameters

- **rowTypeFilter**: Type:String. The value of the row type to filter the rows.

#### Return Value

Type:[FlatlistRowIterable](https://developer.salesforce.com/docs/atlas.en-us.retail_api.meta/retail_api/apex_class_CGCloud_RTRReportResult_FlatListRowIterable.htm#apex_class_CGReporting_RTRReportResult_FlatListRowIterable "Represents a Real Time Reporting (RTR) report UI Flatlist component set of rows. This class implements the Iterable interface that allows it to be used in batch processes.")

### getColumns()

Returns a set that includes all the available column names in the Flatlist.

The method returns the following:

- Dimension attributes—Include the name of the dimension and a report field separated by a dot. For example, productdimension.id, promotiondimension.id, and promotiondimension.phase.
- KPI columns—Include the KPI name. For example, ProPlanIncrVolume.

#### Signature

static RTRReportResult.FlatList getColumns()

#### Return Value

Type:Set<String>

### getRowTypes()

Returns all the available row type filters present in the Flatlist. The row type filters can be used to filter the dataset.

#### Signature

static RTRReportResult.FlatList getRowTypes()

#### Return Value

Type:Set<String>