---
title: 'Liquid filters: first'
description: Returns the first item in an array.
source_url:
  html: 'https://shopify.dev/docs/api/liquid/filters/first'
  md: 'https://shopify.dev/docs/api/liquid/filters/first.md'
api_name: liquid
---

# first

```oobleck
array | first
```

Returns the first item in an array.

##### Code

```liquid
{%- assign first_product = collection.products | first -%}

{{ first_product.title }}
```

##### Data

```json
{
  "collection": {
    "products": [
      {
        "id": 6789374705729,
        "title": "Blue Mountain Flower"
      },
      {
        "id": 6790277595201,
        "title": "Charcoal"
      },
      {
        "id": 6792602320961,
        "title": "Crocodile tears"
      },
      {
        "id": 6792607825985,
        "title": "Dandelion milk"
      },
      {
        "id": 6816899596353,
        "title": "Draught of Immortality"
      },
      {
        "id": 6790315212865,
        "title": "Dried chamomile"
      },
      {
        "id": 6792635580481,
        "title": "Forest mushroom"
      },
      {
        "id": 6823781007425,
        "title": "Gift Card"
      },
      {
        "id": 6792632795201,
        "title": "Glacier ice"
      },
      {
        "id": 6792575352897,
        "title": "Ground mandrake root"
      },
      {
        "id": 6786188247105,
        "title": "Health potion"
      },
      {
        "id": 6786989391937,
        "title": "Invisibility potion"
      },
      {
        "id": 6792613462081,
        "title": "Komodo dragon scale"
      },
      {
        "id": 6784387022913,
        "title": "Love Potion"
      },
      {
        "id": 7067094777921,
        "title": "Mana potion"
      },
      {
        "id": 6817196572737,
        "title": "Potion beats"
      },
      {
        "id": 6821963563073,
        "title": "Potion bottle"
      },
      {
        "id": 6790469058625,
        "title": "Viper venom"
      },
      {
        "id": 6792596455489,
        "title": "Whole bloodroot"
      }
    ]
  }
}
```

##### Output

```html
Blue Mountain Flower
```

### Dot notation

You can use the `first` filter with dot notation when you need to use it inside a tag or object output.

##### Code

```liquid
{{ collection.products.first.title }}
```

##### Data

```json
{
  "collection": {
    "products": [
      {
        "id": 6789374705729,
        "title": "Blue Mountain Flower"
      },
      {
        "id": 6790277595201,
        "title": "Charcoal"
      },
      {
        "id": 6792602320961,
        "title": "Crocodile tears"
      },
      {
        "id": 6792607825985,
        "title": "Dandelion milk"
      },
      {
        "id": 6816899596353,
        "title": "Draught of Immortality"
      },
      {
        "id": 6790315212865,
        "title": "Dried chamomile"
      },
      {
        "id": 6792635580481,
        "title": "Forest mushroom"
      },
      {
        "id": 6823781007425,
        "title": "Gift Card"
      },
      {
        "id": 6792632795201,
        "title": "Glacier ice"
      },
      {
        "id": 6792575352897,
        "title": "Ground mandrake root"
      },
      {
        "id": 6786188247105,
        "title": "Health potion"
      },
      {
        "id": 6786989391937,
        "title": "Invisibility potion"
      },
      {
        "id": 6792613462081,
        "title": "Komodo dragon scale"
      },
      {
        "id": 6784387022913,
        "title": "Love Potion"
      },
      {
        "id": 7067094777921,
        "title": "Mana potion"
      },
      {
        "id": 6817196572737,
        "title": "Potion beats"
      },
      {
        "id": 6821963563073,
        "title": "Potion bottle"
      },
      {
        "id": 6790469058625,
        "title": "Viper venom"
      },
      {
        "id": 6792596455489,
        "title": "Whole bloodroot"
      }
    ]
  }
}
```

##### Output

```html
Blue Mountain Flower
```
