> ## Documentation Index
> Fetch the complete documentation index at: https://docs.uselayers.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Catalog attributes

> Catalog attributes reference fields from your Shopify product data. Learn about attribute codes, nested metafield keys, and automatic metafield creation.

Catalog attributes come directly from your Shopify product data. Their code corresponds to your product schema using dot notation, which allows for the targeting of attributes or nested attributes within your data structure.

For example, a product with a custom metafield called "material" stored under the "custom" namespace would have the attribute code `metafields.custom.material`. This dot notation lets you reach into nested product data to create precise, targeted attributes.

## Nested metafield object keys

When metafield values are JSON objects, you can create attribute codes that access nested object keys. The namespace and key portions must be alphanumeric with underscores, but object keys can contain spaces and special characters.

For instance, if you have a "color\_family" metafield that maps specific shades to general color groups, you can create an attribute that targets each individual mapping within that metafield. This enables you to:

* Create filterable attributes for nested metafield values to enable faceted navigation
* Sort products by nested metafield object values
* Use nested values in merchandising rules and collection filters

<Note>
  This syntax works for both product metafields and variant metafields.
</Note>

## Supported attribute codes

Catalog attribute codes reference product fields using dot notation. The following codes can be made filterable, sortable, or searchable just like any other catalog attribute:

| Code pattern                                             | Description                                                                                                                                                                       | Example                                    |
| :------------------------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :----------------------------------------- |
| `title`, `handle`, `vendor`, `product_type`, `body_html` | Top-level product strings                                                                                                                                                         | `vendor`                                   |
| `available`                                              | Product availability flag                                                                                                                                                         | `available`                                |
| `created_at`, `updated_at`, `published_at`               | Product timestamps                                                                                                                                                                | `published_at`                             |
| `tags`                                                   | Product tags array                                                                                                                                                                | `tags`                                     |
| `collection_titles`                                      | Titles of collections the product belongs to                                                                                                                                      | `collection_titles`                        |
| `is_gift_card`                                           | Whether the product is a gift card                                                                                                                                                | `is_gift_card`                             |
| `has_variants_that_require_components`                   | Whether the product is a bundle parent                                                                                                                                            | `has_variants_that_require_components`     |
| `published_on_web`                                       | Whether the product is published to the Online Store sales channel                                                                                                                | `published_on_web`                         |
| `published_on_app`                                       | Whether the product is published to your storefront app sales channel                                                                                                             | `published_on_app`                         |
| `available_market_ids`                                   | List of Shopify Market IDs the product is available in. One filterable value is indexed per market ID, so customers can filter products by the markets they ship to.              | `available_market_ids`                     |
| `category.{path}`                                        | Drill into Shopify's Standard Product Taxonomy category object                                                                                                                    | `category.full_name`                       |
| `metafields.{namespace}.{key}`                           | Product metafield value                                                                                                                                                           | `metafields.custom.material`               |
| `named_tags.{key}`                                       | Parsed `key:value` named tag                                                                                                                                                      | `named_tags.YearOfRelease`                 |
| `options_v2.{path}`                                      | Drill into the enhanced [options\_v2](/developers/product-schema/variant-data#options_v2-structure) array to filter on option values, swatch data, or linked metafield references | `options_v2.values.linked_metafield_value` |
| `calculated.{key}`                                       | Value produced by a [computed attribute](/platform/attributes/calculated-attributes)                                                                                              | `calculated.discount_percent`              |

<Note>
  Boolean fields (`is_gift_card`, `published_on_web`, `published_on_app`, `has_variants_that_require_components`) are indexed as numeric `1` / `0` values, so you can use them in numeric filter expressions and sort orders.
</Note>

### Filtering by Shopify Market

When [markets sync](/shopify-integration/catalog-sync#markets-sync) is on, every product carries an `available_market_ids` array of the Shopify Markets it is published to. Create a filterable attribute with code `available_market_ids` and value type **number** to expose this as a facet. Use it to let merchandisers segment a collection by region or to power per-market sort orders.

The relation index is refreshed automatically whenever a product's market availability changes, so filters stay in sync with Shopify without a full catalog re-sync.

## Automatic metafield attribute creation

When your catalog is synced, the system automatically creates attributes for metafields that exist on your products but don't have formal metafield definitions in Shopify. The system creates these attributes with conservative defaults (all search/filter settings disabled) to ensure they don't affect your search experience until you explicitly configure them.

**Default settings for auto-created metafield attributes:**

* **Searchable:** Disabled
* **Filterable:** Disabled
* **Sortable:** Disabled
* **Partial Matching:** Disabled

You can review and configure these attributes on the **Attributes** page after they're created. This ensures that all product data is available for configuration, even if metafield definitions haven't been set up in Shopify.

## Creating attributes from metafields

You can create catalog attributes directly from your Shopify metafield definitions on the **Metafields & Metaobjects** settings page. This is useful when you want to quickly make specific metafields available for search, filtering, or sorting without manually entering attribute codes.

**How to create a single attribute:**

<Steps>
  <Step title="Go to the metafields page">
    Go to **Settings** → **Metafields & Metaobjects** in the dashboard.
  </Step>

  <Step title="Select the metafield tab">
    Choose either the **Product Metafields** or **Variant Metafields** tab depending on where the metafield is defined.
  </Step>

  <Step title="Find the metafield">
    Locate the metafield you want to create an attribute for. The **Attribute** column shows whether an attribute already exists for each metafield.
  </Step>

  <Step title="Click Create">
    Click the **Create** button next to any metafield that does not yet have an attribute. The attribute is created immediately with the correct code and a default nickname derived from the metafield name.
  </Step>
</Steps>

**How to create attributes in bulk:**

<Steps>
  <Step title="Select metafields">
    Use the checkboxes on the left side of the table to select multiple metafields. You can also use the header checkbox to select all visible metafields at once.
  </Step>

  <Step title="Click Create Attributes">
    Click the **Create Attributes** button that appears in the top-right corner. The count shown on the button reflects only the selected metafields that do not already have attributes.
  </Step>
</Steps>

Newly created attributes use conservative defaults: searchable, filterable, and sortable are all disabled. After creation, navigate to the **Attributes** page to configure each attribute's settings for your use case.

<Note>
  You can create up to 100 attributes at a time using bulk creation. Metafields that already have a matching attribute are automatically skipped.
</Note>

## Next steps

* [Attribute options](/platform/attributes/attribute-options) — Searchable, filterable, sortable, and visibility settings
* [Attribute classes](/platform/attributes/attribute-classes) — Categorical, feature, and price classifications
* [Computed attributes](/platform/attributes/calculated-attributes) - Creating dynamic attribute values with Functions
* [Product schema](/developers/product-schema) — Understanding your Shopify product data structure
* [Metafields](/developers/product-schema/metafields) — Working with Shopify metafields
