# Filter List

> Keep only the list items that match your conditions, such as a field that contains a word or a date since the last run. Combine rules with AND or OR.

Source: https://nodaro.ai/docs/nodes/automate/filter-list

The **Filter List** node keeps only the items of a list that match your conditions. Each condition tests one field of every item, for example `likes` greater than `1000`, or `caption` contains `sale`. Combine several conditions with AND or OR. Use Filter List to narrow a scraped or generated list before every remaining item runs through the next node. The node is free.

- Found in: Automate › Lists & Batching
- Output: data
- API type: `filter-list`

## When to use it
- Keep only the scraped posts with enough likes before you rewrite them.
- Keep only the feed items published since the last scheduled run.
- Drop the items that miss a field, such as posts without a video.
- Make a batch smaller, and cheaper, before it runs through a paid node.

## Quick start
### Add the node

Press Tab on the canvas and choose **Automate › Lists & Batching › Filter List**.

### Connect a list

Wire a list into the **List** input, for example from [Web Scrape](https://nodaro.ai/docs/nodes/automate/web-scrape), [List](https://nodaro.ai/docs/nodes/automate/list) or [Split Text](https://nodaro.ai/docs/nodes/automate/split-text). Once the upstream node has a result, the settings panel shows the first item under **Upstream sample (first item)**.

### Add conditions

Click **Add condition**. Choose a field, an operator and a value. Add more conditions and choose **AND** or **OR** to combine them.

### Run it

The **Filtered** output carries only the items that pass. To run the next node once per remaining item, set that connection to **Each**.

Workflow: Filter List keeps the popular posts, Extract Field takes their captions, and Prompt rewrites each caption.

- Instagram → Filter List (list)
- Filter List → Extract Field (source)
- Extract Field → Prompt (prompt · Each)

## Inputs and outputs
| Input or output | Accepts or sends | What it does |
| --- | --- | --- |
| **List** | A list of text or JSON items | The list to filter. When a condition names a field, each item is read as JSON. |
| **Filtered** | A list | The items that pass the conditions, in their original order. |

## Settings
| Setting | What it does |
| --- | --- |
| **Conditions** | One row per test: a field, an operator and a value. With no conditions, every item passes. |
| **AND** or **OR** | **AND** keeps an item that passes every condition. **OR** keeps an item that passes at least one. The default is **AND**. |
| **Case-sensitive text matching** | On by default, so `Sale` and `sale` differ. Clear it to ignore upper and lower case. |
| **Upstream sample (first item)** | A preview of the first incoming item, so you can see its fields. The fields your conditions use are marked. |

### Each condition

- **Field** — choose a field detected from the upstream data, **(whole item)** to test the whole item, or **Custom path…** to type a dot path such as `author.name`. **← Back to field list** returns to the detected fields.
- **Operator** — **equals**, **not equals**, **greater than**, **less than**, **greater or equal**, **less or equal**, **contains**, **does not contain**, **starts with**, **ends with**, **matches regex**, **exists** or **does not exist**. **exists** and **does not exist** need no value.
- **Value** — the value to compare with. A toggle next to it switches between a typed value and a variable.

## Filter by date

Some fields hold a date or a time, such as `created_at`, `published_at`, `timestamp`, `date`, or any field that ends in `_at` or `Date`. When a condition uses such a field with **greater than**, **less than**, **greater or equal** or **less or equal**, the value becomes a date picker:

| Choice | Compares with |
| --- | --- |
| **Since last run** | The time the workflow's trigger last fired. It works only in runs started by a trigger or a schedule. A manual run treats it as empty. |
| **Last N hours** | A time N hours before now. |
| **Last N days** | A time N days before now. |
| **Last N weeks** | A time N weeks before now. |
| **Custom…** | Any date you type. |

For example, `published_at` **greater than** **Last N days** with N set to 1 keeps the items published during the last day.

Other fields accept a typed value or one of these variables:

- `{{now}}` — the current time.
- `{{trigger.last_triggered_at}}` — the last time the workflow's trigger fired.
- `{{last_N_hours:3}}`, `{{last_N_days:1}}` and `{{last_N_weeks:2}}` — a time window back from now. Change the number to change the window.

## Credits
Filter List is free.

## Tips
- **Filter before a batch.** Every item you drop is one run of the next node that you do not pay for.
- **Process only new items.** Pair a [Schedule Trigger](https://nodaro.ai/docs/nodes/automate/schedule-trigger) with a **Since last run** condition, and each run handles only what arrived since the previous one.
- **Look at the sample first.** The field names in **Upstream sample (first item)** are the names your conditions must use.
- **Pick instead of filter.** To take one item or a slice by position, use [Selector](https://nodaro.ai/docs/nodes/automate/selector). To put the list in order, use [Sort List](https://nodaro.ai/docs/nodes/automate/sort-list).

## Frequently asked questions

### How do I keep only some items of a list in Nodaro?

Add a Filter List node after the list, with one condition per rule. For example, test that a field contains a word, or that a number is greater than a threshold. The Filtered output carries only the items that pass.

### Can Filter List keep only the items that are new since the last run?

Yes. Choose a date field such as published_at, the operator greater than, and the value Since last run. This works in runs started by a trigger or a schedule; a manual run treats Since last run as empty.

### Does Filter List cost credits?

No. Filter List is free. Filtering a list before a batch also saves credits, because every item you drop is one run of the next node that you do not pay for.

### What is the difference between AND and OR?

AND keeps an item only when it passes every condition. OR keeps an item when it passes at least one condition. AND is the default.
