Skip to content
Salesforce Dictionary - Free Salesforce GlossarySalesforce Dictionary
DictionaryFFilter Condition/Criteria
Core CRMBeginner

Filter Condition/Criteria

A Filter Condition (also called Filter Criteria) in Salesforce is a logical rule that narrows a set of records down to only those that match.

§ 01

Definition

A Filter Condition (also called Filter Criteria) in Salesforce is a logical rule that narrows a set of records down to only those that match. Each condition points at a field, applies an operator such as equals, greater than, or contains, and compares the field to a value or to another field. The rule returns true or false for every record, and only the records that return true are kept.

The same idea shows up almost everywhere on the platform. List view filters, report filters, Flow Decision and Get Records elements, validation rules, and SOQL WHERE clauses all rely on it. The syntax shifts a little between a point-and-click list view and a line of SOQL, but the mechanics stay the same. You name a field, choose an operator, supply a value, and optionally combine several conditions with AND, OR, and NOT logic.

§ 02

Where filter conditions show up across Salesforce

Anatomy of a single condition

Every filter condition has three parts: a field, an operator, and a value. The field says what to look at, such as Stage or Amount. The operator says how to compare, such as equals, less than, or starts with. The value is what you compare against, like Closed Won or 10000. Put together, a condition reads almost like a sentence: Amount greater than 10000. Operators are not interchangeable across field types. Text fields support contains, starts with, and equals. Number, currency, and date fields support less than, greater than, and the range-style comparisons. Multi-select picklists use includes and excludes instead of equals. The Salesforce Help operator reference notes that contains is not case sensitive for most fields, but it is case sensitive when filtering on a roll-up summary field. Some operators are scoped to one place: between appears only in dashboard filters, and within applies only to geolocation fields. Knowing which operator fits which field type is half the work of writing a good filter.

Combining conditions with AND, OR, and NOT

A single condition is rarely enough. Real questions need several rules joined together. Salesforce numbers each filter as you add it, so your first filter becomes Filter 1 and your second becomes Filter 2. You then write filter logic that references those numbers, like 1 AND 2 or (1 AND 2) OR 3. AND keeps records that match both rules. OR keeps records that match either rule. NOT excludes records that match. Parentheses group nested logic so the platform evaluates it in the order you intend. There is one trap worth memorizing. In list views, NOT does not behave well with parenthetical expressions. The Help docs state that 1 AND NOT (2 AND 3) is actually evaluated as 1 AND (NOT 2 AND 3), which can return zero records when you expected several. Rewrite that kind of logic to avoid wrapping NOT around a parenthesis. You can add up to 20 custom filters when you build filter logic on a report or list view.

List view filters

List views on object home pages, such as Accounts, Opportunities, and Cases, use filter conditions to decide which records appear. Common examples are Owner equals Me, Status equals Open, or Close Date equals this quarter. You build them in the Filters panel by picking a field, choosing an operator from the Filter by menu, and entering a value. List view filters carry a few specific limits. The filter logic statement cannot reference a filter number that does not exist. Numeric filters only accept values between the minimum and maximum of a signed 32-bit integer, roughly negative 2.1 billion to 2.1 billion, and a value outside that range disables the filter. To edit list view filters, a user needs Read on the records in the list plus the Create and Customize List Views permission. Because list views are saved as metadata, the same filtered view can be shared with a role, a group, or everyone in the org, which makes them a fast way to give a team a focused worklist.

Report filters

Reports use the same filter concept, layered into a few types. Standard filters cover the basics like date range and record owner. Field filters compare a field to a value, such as Amount greater than 10000. Filter logic combines numbered field filters with AND, OR, and NOT. Filter logic does not apply to standard filters, only to the field filters you add. Two report-only filter types are worth knowing. Cross filters let you filter on the presence or absence of related records, such as Accounts without Opportunities, and each report can hold up to three cross filters with up to five subfilters each. Field-to-field filters compare two report fields directly, for example cases where the last modified date is after the closed date. As with list views, you can add up to 20 field filters. A useful habit is to start broad, add filters one at a time, and check the row count after each one. That tells you exactly which condition removed the records you were not expecting to lose.

Flow Decisions and Get Records

Flow leans on filter conditions in several elements. A Decision element routes the flow down different paths based on conditions you define, like checking whether a record Stage equals Closed Won. A Get Records element pulls records that match a filter, such as Contacts where Mailing Country equals USA. An Update Records element can filter which records to change. A Start element on a record-triggered flow uses entry conditions to decide whether the flow should run at all. Each of these is a small filter-criteria expression built with the same field, operator, value pattern. Flow also lets you choose whether all conditions must be met, any condition can be met, or custom logic applies, which mirrors AND, OR, and custom filter logic elsewhere. Putting conditions on the Get Records and Start elements rather than checking them later in the flow is good practice. It keeps the flow from doing work on records it was always going to ignore, which matters for both speed and governor limits.

SOQL WHERE clauses

In code, filter conditions live in the WHERE clause of a SOQL query. A query like SELECT Id, Name FROM Account WHERE Industry = 'Technology' AND BillingCountry = 'USA' filters Accounts to a precise set. The comparison operators include =, !=, <, <=, >, >=, LIKE, IN, and NOT IN. LIKE supports wildcards for partial text matching, and INCLUDES and EXCLUDES handle multi-select picklists. Logical operators AND, OR, and NOT join field expressions, with parentheses controlling precedence. SOQL adds power that point-and-click filters do not have. Date literals like TODAY, YESTERDAY, LAST_N_DAYS:30, and THIS_QUARTER express relative time ranges that stay correct as the calendar moves. Semi-joins and anti-joins, written as IN or NOT IN against a subquery, filter one object based on related records in another. The same operator vocabulary you learned in list views and reports carries straight into SOQL, which is why time spent understanding filter conditions pays off across both admin and developer work.

§ 03

How to build a filtered list view

The most hands-on way to build a filter condition is to create a filtered list view in Lightning Experience. The steps below add one or more conditions and, if needed, filter logic to control how they combine.

  1. Open the list view controls

    Go to an object home page such as Opportunities. Click the list view controls gear, then choose New to create a list view, or select an existing one and open the Filters panel from the same gear menu.

  2. Add a filter condition

    In the Filters panel, click Add Filter. Pick the field to filter, select an operator from the Filter by dropdown such as equals or greater than, enter or select a value, then click Done.

  3. Add more conditions as needed

    Repeat Add Filter for each rule. Each new filter is numbered automatically. By default the conditions are joined with AND, so a record must satisfy every filter to appear.

  4. Apply filter logic for OR or NOT

    If you need OR or NOT, click Add Filter Logic and write a statement referencing the filter numbers, such as 1 AND (2 OR 3). Avoid wrapping NOT around a parenthesis, which list views evaluate incorrectly.

  5. Save and share the view

    Click Save, name the list view, and set who can see it (just you, a group, or all users). The filtered view is stored as metadata and refreshes automatically as records change.

Fieldremember

The record field the condition evaluates, such as Stage, Amount, or Owner. Available fields depend on the object and your access.

Operatorremember

How the field is compared: equals, not equal to, greater than, contains, starts with, includes, and so on. The choices change with the field type.

Valueremember

What the field is compared against. Number filters only accept values within the signed 32-bit integer range, or the filter is disabled.

Filter Logicremember

An optional statement that combines numbered filters with AND, OR, and NOT. Without it, all conditions are joined by AND.

Gotchas
  • NOT around a parenthetical expression is evaluated incorrectly in list views, so 1 AND NOT (2 AND 3) can return zero records. Rewrite the logic to avoid it.
  • Filter logic can reference up to 20 custom filters, and it cannot reference a filter number that does not exist.
  • Numeric filter values must fall between roughly negative 2.1 billion and 2.1 billion; a value outside that signed 32-bit range disables the filter.
  • Editing list view filters requires Read on the records plus the Create and Customize List Views permission.

Prefer this walkthrough as its own page? How to Filter Condition/Criteria in Salesforce, step by step

§

Trust & references

Sources

Cross-checked against the following references.

Official documentation

Straight from the source - Salesforce's reference material on Filter Condition/Criteria.

Was this entry helpful?
Help us write better definitions. Quick reactions or detailed edit suggestions.

About the Author

Dipojjal Chakrabarti is a B2C Solution Architect with 29 Salesforce certifications and over 13 years in the Salesforce ecosystem. He runs salesforcedictionary.com to help admins, developers, architects, and cert/interview candidates sharpen their fundamentals. More about Dipojjal.

§

Test your knowledge

Q1. What is a Filter Condition (also called Filter Criteria) in Salesforce?

Q2. Across which range of Salesforce surfaces does the same Filter Condition pattern appear?

Q3. Why does the choice of AND, OR, and grouping matter so much in a multi-condition filter?

§

Discussion

Loading…

Loading discussion…