# Advanced Filtering in Baserow - Nested Condition Groups

> Nest Baserow filters into AND/OR condition groups to build queries like (this AND that) OR something else, without touching a line of code.

Source: https://opennix.org/en/docs/baserow/views/advanced-filtering/


Advanced filtering unlocks database-level querying power in Baserow: combine multiple conditions with AND/OR logic and nested groups to find exactly what you need, even in tables with thousands of records. This article explains how to build complex filters using condition groups, nested logic, and combined criteria - no code required.

## Overview

Advanced filtering extends basic filtering by letting you build condition groups - sets of filters combined with a logic operator that can nest inside each other for complex queries. Where a basic filter applies one simple rule across the table, advanced filtering lets you build queries shaped like "if this AND that, OR something else."

Condition groups work like parentheses in a math expression, controlling how filters combine. You can build a filter that reads "show (high priority AND overdue) OR (medium priority AND assigned to me)" to capture data patterns a flat filter list simply can't express.

Advanced filtering applies across several Baserow features, including row filtering in a view and conditional logic on form fields, giving you the same querying power throughout the platform.

## Understanding condition groups

A condition group is a set of filters joined by AND or OR logic that get evaluated together. Each group resolves to true or false, and groups can combine with other groups or individual filters to build a complex query.

### AND vs. OR logic behavior

| Logic type | Behavior | Result | Example |
|---|---|---|---|
| **AND** | Every condition must be true | Stricter, fewer results | "Status = In Progress" AND "Priority = High" (only rows matching both) |
| **OR** | Any condition can be true | More permissive, more results | "Status = Blocked" OR "Status = At risk" (rows matching either) |

### Why use condition groups

**Simple filter:** Priority = High _(shows every high-priority record)_.

**Condition group:** (Priority = High AND Status = In Progress) OR (Priority = Critical) _(shows high-priority items only when they're in progress, but shows every critical item regardless of status)_.

Grouped logic lets you express "show me this specific combination OR that other thing" in ways a flat filter list never can.

## When to use advanced filtering

**Complex business rules.** Display records that meet a multi-part criterion, such as "(customer tier = enterprise AND contract value > $100k) OR (renewal date in the next 30 days)."

**Exception handling.** Show standard items under one set of conditions, but include exceptions too: "(status = active AND last contact < 30 days ago) OR (VIP customer = true)."

**Multi-team workflows.** Combine department-specific conditions, like "(department = sales AND stage = negotiation) OR (department = support AND priority = urgent)."

**Date range combinations.** Build temporal filters such as "(created this year AND modified this month) OR (flagged for review = true)."

**Data validation.** Find records that break a business rule: "(required field is empty AND status != draft) OR (approval date is empty AND status = approved)."

## How to create condition groups

Build a condition group by adding filters and combining them with logic operators.

To create a basic condition group:

1. Open your table and click the **Filter** button in the view toolbar.
2. Click **+ Add Filter** to add your first condition.
3. Select a field, operator, and value for the first filter.
4. Click **+ Add Filter** again for the second condition.
5. Choose **And** or **Or** from the logic dropdown between filters.
6. Keep adding filters as needed.

The table updates in real time to show only rows matching the condition group.

To create nested condition groups:

1. Open your table and click **Add filter group** in the view toolbar.
2. Select the filters you want to group together.
3. Turn them into a subgroup with its own AND/OR logic.
4. Add more filters or groups at the parent level.
5. Mix AND/OR logic across different nesting levels.

Example nested structure:

```
Show rows where:
  (Priority = High AND Status = In Progress)
  OR
  (Department = Sales AND (Region = West OR Region = East))
```

## Condition group nesting strategies

| Strategy | Structure | Use case |
|---|---|---|
| **Flat groups** | All filters at one level, single logic type | Simple "everything must match" or "one match is enough" queries |
| **Single nest** | One group combined with individual filters | "Show exceptions OR these specific items" |
| **Multiple groups** | Several groups at the same level joined by OR | "Show category A OR category B OR category C," each with its own conditions |
| **Deep nesting** | Groups inside groups | Complex business rules with several layers of logic |

## Using advanced filtering across Baserow

Advanced filtering powers several Baserow features, keeping the behavior consistent across the platform.

### Row filtering

Apply condition groups in a view's filters to show only rows matching a complex criterion. Each view keeps an independent filter configuration. See [Filters in Baserow](/docs/baserow/views/filters-in-baserow/) for the basics.

### Conditional form fields

Show or hide form fields dynamically based on a condition group. Example: display a "Discount reason" field when "(customer tier = enterprise) OR (order value > $10k)."

## Combined date filters

Date filtering supports several conditions at once, letting you build precise time ranges.

To create a combined date filter:

1. Open the [filter panel](/docs/baserow/views/filters-in-baserow/) in your table.
2. Select a date field to filter.
3. Choose your first date operator (is before, is after, is on, and so on).
4. Pick a reference point (today, tomorrow, yesterday, or a custom date).
5. Click **+ Add Filter** to add another date condition.
6. Choose a different operator and reference point.
7. Set the logic (AND/OR) between the date filters.

**Example: show records due soon**

- Filter 1: Due date "is after" yesterday;
- Logic: AND;
- Filter 2: Due date "is before" tomorrow;
- **Result:** shows only items due today.

**Example: show items from specific periods**

- Filter 1: Created date "in this year";
- Logic: AND;
- Filter 2: Modified date "in this month";
- **Result:** shows items created this year but modified this month.

## Advanced filtering logic examples

### Example 1: sales pipeline filter

```
Show opportunities where:
  (Stage = Negotiation AND Value > $50k)
  OR
  (Stage = Proposal AND Days-in-stage > 14)
  OR
  (Owner = Current user AND Status = Action required)
```

**Result:** shows high-value negotiations, stalled proposals, and your action items.

### Example 2: customer health monitoring

```
Show customers where:
  (Last purchase date > 90 days ago AND Support tickets > 5)
  OR
  (Contract value > $100k AND Last contact date > 30 days ago)
  OR
  (Renewal date in next 60 days AND Health score = Red)
```

**Result:** identifies at-risk customers who need attention.

### Example 3: task prioritization

```
Show tasks where:
  (Priority = Urgent AND Status != Complete)
  OR
  (Due date is today AND Assigned to = Current user)
  OR
  (Blocked = true AND Days blocked > 3)
```

**Result:** your urgent tasks, today's assignments, and long-blocked items.

## Frequently asked questions

**What's the difference between basic and advanced filtering?** Basic filtering uses a flat list of conditions with one AND or OR logic throughout. Advanced filtering lets you nest condition groups with different logic at each level, enabling queries like "(this AND that) OR (something else)."

**How many condition groups can I create?** There's no fixed limit on nesting depth or number of groups. For performance and maintainability, though, keep filters as simple as the task allows - very complex filters can slow view loading on large tables.

**Can I save and reuse a condition group?** Condition groups save with each view. To reuse a complex filter, duplicate the view or build a template view with the configuration you want, then adapt it for the new use case.

**Do condition groups work with every field type?** Yes, condition groups support every field type and its operators. You can mix field types within the same group - combining text, date, and number filters in one condition group, for instance.

**How do I know if my condition group is right?** Check the row count shown in the filter panel. If it looks off, simplify by testing one condition at a time, then add complexity gradually. The real-time preview helps confirm the logic.

## Related content

- [Basic filtering in Baserow](/docs/baserow/views/filters-in-baserow/) - the fundamental filtering concepts;
- [View customization](/docs/baserow/views/view-customization/) - every other view configuration option;
- [Group rows by field](/docs/baserow/views/group-rows-in-baserow/) - organize filtered results into groups;
- [Field customization](/docs/baserow/fields/field-customization/) - field types and their operators.

