---
title: 'Liquid filters: where'
description: Filters an array to include only items with a specific property value.
source_url:
  html: 'https://shopify.dev/docs/api/liquid/filters/where'
  md: 'https://shopify.dev/docs/api/liquid/filters/where.md'
api_name: liquid
---

# where

```oobleck
array | where: string, string
```

Filters an array to include only items with a specific property value.

This requires you to provide both the property name and the associated value.

##### Code

```liquid
{% assign polina_products = collection.products | where: 'vendor', "Polina's Potent Potions" %}

Products from Polina's Potent Potions:

{% for product in polina_products -%}
  - {{ product.title }}
{%- endfor %}
```

##### Data

```json
{
  "collection": {
    "products": [
      {
        "title": "Blue Mountain Flower",
        "vendor": "Polina's Potent Potions"
      },
      {
        "title": "Charcoal",
        "vendor": "Ted's Apothecary Supply"
      },
      {
        "title": "Crocodile tears",
        "vendor": "Polina's Potent Potions"
      },
      {
        "title": "Dandelion milk",
        "vendor": "Clover's Apothecary"
      },
      {
        "title": "Draught of Immortality",
        "vendor": "Polina's Potent Potions"
      },
      {
        "title": "Dried chamomile",
        "vendor": "Clover's Apothecary"
      },
      {
        "title": "Forest mushroom",
        "vendor": "Clover's Apothecary"
      },
      {
        "title": "Gift Card",
        "vendor": "Polina's Potent Potions"
      },
      {
        "title": "Glacier ice",
        "vendor": "Ted's Apothecary Supply"
      },
      {
        "title": "Ground mandrake root",
        "vendor": "Clover's Apothecary"
      },
      {
        "title": "Health potion",
        "vendor": "Polina's Potent Potions"
      },
      {
        "title": "Invisibility potion",
        "vendor": "Polina's Potent Potions"
      },
      {
        "title": "Komodo dragon scale",
        "vendor": "Ted's Apothecary Supply"
      },
      {
        "title": "Love Potion",
        "vendor": "Polina's Potent Potions"
      },
      {
        "title": "Mana potion",
        "vendor": "Polina's Potent Potions"
      },
      {
        "title": "Potion beats",
        "vendor": "Polina's Potent Potions"
      },
      {
        "title": "Potion bottle",
        "vendor": "Polina's Potent Potions"
      },
      {
        "title": "Viper venom",
        "vendor": "Ted's Apothecary Supply"
      },
      {
        "title": "Whole bloodroot",
        "vendor": "Clover's Apothecary"
      }
    ]
  }
}
```

##### Output

```html
Products from Polina's Potent Potions:

- Blue Mountain Flower
- Crocodile tears
- Draught of Immortality
- Gift Card
- Health potion
- Invisibility potion
- Love Potion
- Mana potion
- Potion beats
- Potion bottle
```

### Filter for boolean properties with a `true` value

You can filter for items that have a `true` value for a boolean property. This requires you to provide only the property name.

##### Code

```liquid
{% assign available_products = collection.products | where: 'available' %}

Available products:

{% for product in available_products -%}
  - {{ product.title }}
{%- endfor %}
```

##### Data

```json
{
  "collection": {
    "products": [
      {
        "available": false,
        "title": "Blue Mountain Flower"
      },
      {
        "available": true,
        "title": "Charcoal"
      },
      {
        "available": false,
        "title": "Crocodile tears"
      },
      {
        "available": false,
        "title": "Dandelion milk"
      },
      {
        "available": true,
        "title": "Draught of Immortality"
      },
      {
        "available": true,
        "title": "Dried chamomile"
      },
      {
        "available": false,
        "title": "Forest mushroom"
      },
      {
        "available": true,
        "title": "Gift Card"
      },
      {
        "available": false,
        "title": "Glacier ice"
      },
      {
        "available": true,
        "title": "Ground mandrake root"
      },
      {
        "available": true,
        "title": "Health potion"
      },
      {
        "available": true,
        "title": "Invisibility potion"
      },
      {
        "available": false,
        "title": "Komodo dragon scale"
      },
      {
        "available": false,
        "title": "Love Potion"
      },
      {
        "available": true,
        "title": "Mana potion"
      },
      {
        "available": true,
        "title": "Potion beats"
      },
      {
        "available": false,
        "title": "Potion bottle"
      },
      {
        "available": true,
        "title": "Viper venom"
      },
      {
        "available": true,
        "title": "Whole bloodroot"
      }
    ]
  }
}
```

##### Output

```html
Available products:

- Charcoal
- Draught of Immortality
- Dried chamomile
- Gift Card
- Ground mandrake root
- Health potion
- Invisibility potion
- Mana potion
- Potion beats
- Viper venom
- Whole bloodroot
```
