Smart collections with metafields

Smart collections use selection conditions to automatically include matching products. You can add up to 60 selection conditions in a single collection, and you can specify if products need to meet all conditions or any condition to be included in the collection.

Complete the following actions before you create a smart collection by metafields:

Benefits of smart collections by metafields

Smart collections by metafields help you create more accurate collections for your products and variants compared to product tags. For example, you can set up a collection using the tags that include red. However, red is used for product color, and urgency-red is used for fulfillment urgency. In this example, your collection would have products that are both the color red and have a fulfillment urgency of urgency-red, because they both include red. In this example, tags aren't going to work for your color red collection.

Because metafields are part of your data model, you can integrate this same data across Shopify, such as your online store. You can use metafields to be more specific in your collections. You can create metafield definitions for color, and then create a collection that only pulls in products that have the color value you want for the collection. You can create a metafield definition that is for fulfillment urgency, and then create a collection that only pulls in products that are marked with an urgent fulfillment value. Metafields provide more flexibility and structure than tags.

Limitations

Smart collections by metafield conditions have the following limitations:

  • You can only use product or variant metafield definitions and values in your smart collections.
  • If you add a metafield to a variant and create a smart collection for that metafield, then your smart collection will pull in the whole product with the other variants.
  • The activate smart collections setting has a maximum of 128 definitions per product metafield definitions and variant metafield definitions.
  • You can't delete a metafield definition until the collection is updated to remove the metafield definition as a condition.

Metafield definitions and supported conditions

Only certain metafield product and variant definitions are supported with specific conditions.

Metafield definitions and supported conditions for smart collections
Metafield definition typeSupported conditions
True or falseequals
Integerequals
greater than
less than
Decimalequals
greater than
less than
Ratingequals
greater than
less than
Single line text (one value and list of values)equals

Activating the smart collections setting

To use a metafield definition for smart collections, you need to activate the setting in your metafield definitions.

Desktop

Steps:

  1. From your Shopify admin, go to Settings > Custom data.

  2. Depending on the metafield definition you want to use for smart collections, select either Products or Variants.

  3. Click the metafield definition that you want to use for your collection.

  4. In the Options section, select Smart collections.

  5. Click Save.

iPhone
  1. From the Shopify app, tap the button, and then tap Settings.
  2. In the Store settings section, select Custom data.
  3. Depending on the metafield definition you want to use for smart collections, select either Products or Variants.
  4. Tap the metafield definition you want to use for your collection.
  5. In the Options section, tap Smart collections.
  6. Tap Save.
Android
  1. From the Shopify app, tap the button, and then tap Settings.
  2. In the Store settings section, select Custom data.
  3. Depending on the metafield definition you want to use for smart collections, select either Products or Variants.
  4. Tap the metafield definition you want to use for your collection.
  5. In the Options section, tap Smart collections.
  6. Tap Save.

Learn more about creating custom metafield definitions.

Create smart collections with metafield definition conditions

You can add a condition to include products or variants with a particular metafield.

The first column of the drop-down list for your smart collection conditions is the name of your metafield definition. The second column is your supported conditions, such as equals. The third column is for your metafield values and is a drop-down list or text box. Only metafield definitions with the smart collections setting activated display.

For example, to set up a condition that selects products with the metafield definition Color and the value #FF0000:

Steps:

Desktop
  1. From your Shopify admin, go to Products > Collections.

  2. Click Create collection.

  3. Enter a title and description for the collection.

  4. In the Collection type section, click Smart and then do the following:

    1. Select whether products need to match all conditions or any condition to be included in the collection.
    2. Select Color from the first column drop-down.
    3. Select is equal to from the second column.
    4. Type #FF0000.
  5. Click Save. In the Products section that's displayed, the products that match the conditions are automatically added to the collection.

iPhone
  1. From the Shopify app, go to Products > Collections.
  2. Tap the + button.
  3. Enter a title and description for the collection.
  4. Activate Automatically select products.
  5. Tap Add next to Conditions.
  6. In the Metafields section, tap Color.
  7. Tap is equal to.
  8. Type #FF0000.
  9. Tap Save.
Android
  1. From the Shopify app, go to Products > Collections.
  2. Tap the + button.
  3. Enter a title and description for the collection.
  4. Activate Automatically select products.
  5. Tap Add next to Conditions.
  6. In the Metafields section, tap Color.
  7. Tap is equal to.
  8. Type #FF0000.
  9. Tap Save.

Learn more about smart collections.

Can’t find the answers you’re looking for? We’re here to help.