---
schema_version: "1"
id: ebf17f61e313d593830b86a5c753883211e405d7fc91c3272415577e84cdac25
title: ColumnSelection Class
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_class_DataSource_ColumnSelection.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_DataSource_ColumnSelection.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: d1f6b72f1a033a8b5e703352e2ec1eb02a2764f4b82fc46f51b5fab80722b847
description: Identifies the list of columns to return during a query or search.How to aggregate the column’s data.Name of the selected column.Name of the column’s table.
---
# ColumnSelection Class

Identifies the list of columns to return during a query or search.

## Namespace

[DataSource Namespace](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_namespace_DataSource.htm "The DataSource namespace provides the classes for the Apex Connector Framework. Use the Apex Connector Framework to develop a custom adapter for Salesforce Connect. Then connect your Salesforce organization to any data anywhere via the Salesforce Connect custom adapter.")

## Usage

This class is associated with the SELECT clause for a SOQL query, or the RETURNING clause for a SOSL query.

- **[ColumnSelection Properties](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_DataSource_ColumnSelection.htm#apex_DataSource_ColumnSelection_properties)**

## ColumnSelection Properties

The following are properties for ColumnSelection.

- **[aggregation](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_DataSource_ColumnSelection.htm#apex_DataSource_ColumnSelection_aggregation)**  
    How to aggregate the column’s data.
- **[columnName](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_DataSource_ColumnSelection.htm#apex_DataSource_ColumnSelection_columnName)**  
    Name of the selected column.
- **[tableName](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_DataSource_ColumnSelection.htm#apex_DataSource_ColumnSelection_tableName)**  
    Name of the column’s table.

### aggregation

How to aggregate the column’s data.

#### Signature

public DataSource.QueryAggregation aggregation {get; set;}

#### Property Value

Type: [DataSource.QueryAggregation](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_enum_DataSource_QueryAggregation.htm "Specifies how to aggregate a column in a query.")

### columnName

Name of the selected column.

#### Signature

public String columnName {get; set;}

#### Property Value

Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")

### tableName

Name of the column’s table.

#### Signature

public String tableName {get; set;}

#### Property Value

Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")