Product Reference Metafields

Product reference metafields are Shopify metafields that point to another product. They can be used for storing data like related products and are also used by the Shopify Search & Discovery app.

Shopify also supports metafields that are a list of product references allowing you to store relationships to multiple products in a single field.

In-app edit

You can use the app to set a single product metafield. When you select that field to edit, you will have the option of choosing a product that you want to reference for that field.

If you are editing a metafield that is a list of product references you have the following options:

  • Set the metafield to a new list of product references
  • Add products to the start or end of the list
  • Remove products from the start or end of the list
  • Clear the metafield value

Spreadsheets

By default, the app uses product handles to manage product reference metafields in spreadsheets. The use of handles instead of the native Shopify format (which looks like gid://shopify/Product/123456789) makes it easier to view and to transfer between development stores.

When you export a product reference metafield to a spreadsheet it will be in the following format:

  • A single product reference: related-product-handle
  • A list of product references: product-one,product-two,product-three

If you're updating product reference metafields with a spreadsheet the app accepts the handles as well as the native Shopify format.

For a single product reference both of these formats are accepted:

  • related-product-handle
  • gid://shopify/Product/123456789

And the app accepts either of the following for a list of product references:

  • product-one,product-two,product-three
  • ["gid://shopify/Product/123456789", "gid://shopify/Product/987654321"]
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.