---
schema_version: "1"
id: 220960479fe14ec1afbef60b1604dd6f7db8be520a85b426e619d5a973a93af0
title: TableSelection Class
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_class_DataSource_TableSelection.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_DataSource_TableSelection.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 0e796c671c7e2c7788757321b0d652258076916b70125bb16d3d61e65a561524
description: Contains a breakdown of the SOQL or SOSL query. Its properties represent the FROM, ORDER BY, SELECT, and WHERE clauses in the query.List of columns to query. Corresponds to the SELECT clause in a SOQL or SOSL query.Identifies the query filter, which can be a compound filter that has a list of subfilters. The filter corresponds to the WHERE clause in a SOQL or SOSL query.Identifies the order for sorting the query results. Corresponds to the ORDER BY clause in a SOQL or SOSL query.Name of the table to query. Corresponds to the FROM clause in a SOQL or SOSL query.
---
# TableSelection Class

Contains a breakdown of the SOQL or SOSL query. Its properties represent the FROM, ORDER BY, SELECT, and WHERE clauses in the query.

## Namespace

[DataSource](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.")

- **[TableSelection Properties](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_DataSource_TableSelection.htm#apex_DataSource_TableSelection_properties)**

## TableSelection Properties

The following are properties for TableSelection.

- **[columnsSelected](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_DataSource_TableSelection.htm#apex_DataSource_TableSelection_columnsSelected)**  
    List of columns to query. Corresponds to the SELECT clause in a SOQL or SOSL query.
- **[filter](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_DataSource_TableSelection.htm#apex_DataSource_TableSelection_filter)**  
    Identifies the query filter, which can be a compound filter that has a list of subfilters. The filter corresponds to the WHERE clause in a SOQL or SOSL query.
- **[order](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_DataSource_TableSelection.htm#apex_DataSource_TableSelection_order)**  
    Identifies the order for sorting the query results. Corresponds to the ORDER BY clause in a SOQL or SOSL query.
- **[tableSelected](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_DataSource_TableSelection.htm#apex_DataSource_TableSelection_tableSelected)**  
    Name of the table to query. Corresponds to the FROM clause in a SOQL or SOSL query.

### columnsSelected

List of columns to query. Corresponds to the SELECT clause in a SOQL or SOSL query.

#### Signature

public List<DataSource.ColumnSelection> columnsSelected {get; set;}

#### Property Value

Type: List<[DataSource.ColumnSelection](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_DataSource_ColumnSelection.htm#apex_class_DataSource_ColumnSelection "Identifies the list of columns to return during a query or search.")\>

### filter

Identifies the query filter, which can be a compound filter that has a list of subfilters. The filter corresponds to the WHERE clause in a SOQL or SOSL query.

#### Signature

public DataSource.Filter filter {get; set;}

#### Property Value

Type: [DataSource.Filter](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_DataSource_Filter.htm#apex_class_DataSource_Filter "Represents a WHERE clause in a SOSL or SOQL query.")

### order

Identifies the order for sorting the query results. Corresponds to the ORDER BY clause in a SOQL or SOSL query.

#### Signature

public List<DataSource.Order> order {get; set;}

#### Property Value

Type: List<[DataSource.Order](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_DataSource_Order.htm#apex_class_DataSource_Order "Contains details about how to sort the rows in the result set. Equivalent to an ORDER BY statement in a SOQL query.")\>

### tableSelected

Name of the table to query. Corresponds to the FROM clause in a SOQL or SOSL query.

#### Signature

public String tableSelected {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.")