---
schema_version: "1"
id: 1086edb59834d0d178e2a73d6a0e9037d34cb8132e1939aebfdc5c955f148a42
title: Filter Class
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_class_DataSource_Filter.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_DataSource_Filter.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 0ccc37465affcc83d0ba646071a63005f33e282f1e566a787ccc541c3c763f37
description: Represents a WHERE clause in a SOSL or SOQL query. Name of the column that’s being evaluated in a simple comparative type of filter.Value that the filter compares records against in a simple comparative type of filter.List of subfilters for compound filter types, such as NOT_, AND_, and OR_.Name of the table whose column is being evaluated in a simple comparative type of filter.Type of filter operation that limits the returned data.
---
# Filter Class

Represents a WHERE clause in a SOSL or SOQL 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.")

## Usage

Compound types require child filters. Specifically, the subfilters property can’t be null if the type property is NOT\_, AND\_, or OR\_.

- **[Filter Properties](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_DataSource_Filter.htm#apex_DataSource_Filter_properties)**

## Filter Properties

The following are properties for Filter.

- **[columnName](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_DataSource_Filter.htm#apex_DataSource_Filter_columnName)**  
    Name of the column that’s being evaluated in a simple comparative type of filter.
- **[columnValue](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_DataSource_Filter.htm#apex_DataSource_Filter_columnValue)**  
    Value that the filter compares records against in a simple comparative type of filter.
- **[subfilters](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_DataSource_Filter.htm#apex_DataSource_Filter_subfilters)**  
    List of subfilters for compound filter types, such as NOT\_, AND\_, and OR\_.
- **[tableName](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_DataSource_Filter.htm#apex_DataSource_Filter_tableName)**  
    Name of the table whose column is being evaluated in a simple comparative type of filter.
- **[type](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_DataSource_Filter.htm#apex_DataSource_Filter_type)**  
    Type of filter operation that limits the returned data.

### columnName

Name of the column that’s being evaluated in a simple comparative type of filter.

#### 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.")

### columnValue

Value that the filter compares records against in a simple comparative type of filter.

#### Signature

public Object columnValue {get; set;}

#### Property Value

Type: Object

### subfilters

List of subfilters for compound filter types, such as NOT\_, AND\_, and OR\_.

#### Signature

public List<DataSource.Filter> subfilters {get; set;}

#### Property Value

Type: [List](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_list.htm#apex_methods_system_list "Contains methods for the List collection type.")<[DataSource.Filter](#apex_class_DataSource_Filter "Represents a WHERE clause in a SOSL or SOQL query.")\>

### tableName

Name of the table whose column is being evaluated in a simple comparative type of filter.

#### 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.")

### type

Type of filter operation that limits the returned data.

#### Signature

public DataSource.FilterType type {get; set;}

#### Property Value

Type: [DataSource.FilterType](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_enum_DataSource_FilterType.htm "Referenced by the type property on a DataSource.Filter.")