# Build a smart collection

Write conditions that decide which products belong, combine them with all or any, and check the live preview before saving.

A smart collection describes its members instead of listing them. You write the conditions, Storefront finds everything that matches, and it keeps matching as the catalogue changes.

![The Conditions and Live preview cards on a smart collection. Products must match is set to Any condition, and one rule reads Tag is equal to next-day. Live preview reports 16 products match and shows the first ten as cards with their images, names and SKUs.](https://www.sorviai.com/help/storefront/collections/smart-conditions.png)

*The preview counts and lists the matches before you save.*

> **Before you start:**
>
> A collection with **Collection type** set to **Smart**.

## Write the conditions

- Open the collection and find **Conditions**.
- Beside **Products must match**, choose **All conditions** or **Any condition**.
- Choose what to test in the first list, such as **Tag** or **Price**.
- Choose how to compare it in the second, such as **is equal to** or **is greater than**.
- Enter the value to compare against.
- Select **Add condition** for another, then select **Save**.

**All conditions** narrows: a product has to satisfy every row. **Any condition** widens: one row is enough. Two rows under **All** asking for a price under fifty and a type of goods is a different collection from the same two rows under **Any**.

## What you can test

*The conditions available in the Conditions editor*

The comparisons on offer change with what you are testing. A number offers **is greater than** and **is less than**; text offers **contains**, **starts with** and **ends with**; everything offers **is set** and **is not set**, which take no value at all.

## Check the preview before saving

**Live preview** sits beside the conditions and updates as you type, saying how many products match and listing them. A product still in draft is marked, so you can tell the difference between a rule that matches nothing and a rule that matches things no shopper can see yet.

> **Tip:**
>
> Start with one condition and read the preview, then add the second. A collection that suddenly matches nothing is almost always a value spelled differently from the products, and finding that with one rule on screen is far quicker than with four.

## What happens after you save

Membership recomputes when you save, and again whenever a product changes in a way that affects it. Nobody has to revisit the collection to keep it current, which is the whole point of a smart one.

> **Note:**
>
> Products pinned by hand before the collection became smart are kept and stay in it. Rules add members; they do not evict the ones you placed yourself.
