Skip to content

Connect product fields

Shopify gives every product a name, a price, a vendor and a type, but no field for a serving size or a facts table. You create those fields yourself, as metafields. Then you connect them to the theme’s settings in the theme editor. After that, every product shows its own values.

Dose never needs a field with a particular name. You choose the field when you connect it, so name your fields as you like.

  1. Create a field for products in your Shopify admin, for example “Serving size”.
  2. Fill it in on each product.
  3. Connect a theme setting to that field in the theme editor, with Connect dynamic source.

A setting that can be connected shows the Connect dynamic source button beside it. Once connected, the setting shows the field’s name instead of a value.

These are suggestions. Create the ones you need.

Field name (your choice) Type to pick Where Dose shows it
Format line Single line text Product cards, under the name. For example “Unflavored powder · 300 g”
Key active Single line text A Fact row on the product page and a row on product cards
Per serving Single line text A Fact row on the product page and a row on product cards
Servings Integer A Fact row on the product page
Serving size Single line text The facts panel’s Serving size
Facts rows Single line text, list of values The facts panel’s Rows
Amount per kg Decimal The dose calculator’s Amount per kg of body weight
Serving amount Integer or decimal The dose calculator’s Serving size
Container size Weight, integer or decimal The dose calculator’s Container size, when you do not use variant weights
  1. In your Shopify admin, go to Settings > Custom data.
  2. Click Products.
  3. Click Add definition.
  4. Enter a Name, such as “Serving size”. Shopify fills in the namespace and key, such as custom.serving_size. You don’t need to change them.
  5. Click Select type and choose the type from the table above. For “Facts rows”, choose Single line text, then List of values.
  6. Click Save.
  1. In your Shopify admin, open a product.
  2. Scroll to Metafields at the bottom of the page.
  3. Click the field and enter the value.
  4. For a list field, such as “Facts rows”, enter one row per value, written as Name | Amount | Daily value.
  5. Click Save.

Example values for a facts list:

Creatine monohydrate | 5 g | †
Calories | 0 |
Sodium | 0 mg | 0%
  1. In the theme editor, choose Products > Default product in the page list at the top.
  2. Select the block, for example the Fact row labeled “Per serving”.
  3. Beside Value, click Connect dynamic source.
  4. Choose the field, for example “Per serving”.
  5. Click Save.

Every product that uses the template now shows its own value. A product with no value for the field does not show that row.

Product cards appear in the Product list section, on collection pages, in search results and in Related products. Each of these has a Product card block inside it, which sets what the cards show.

  1. In the theme editor, select the section, for example the Collection section on a collection page.
  2. Select its Product card block.
  3. Beside Format line, click Connect dynamic source and choose your “Format line” field.
  4. To add a fact row, set Third row to Custom. Type a Third row label, such as “Per serving”.
  5. Beside Third row value, click Connect dynamic source and choose the field.
  6. Click Save.

One connection works for every card in the list. Each card shows its own product’s value, and a product with no value does not show that row.

The First row and Second row can also show the product’s Vendor or Product type, which every product has.

The calculator needs numbers, not text.

  1. Create a field “Amount per kg” of type Decimal.
  2. Create a field “Serving amount” of type Integer or Decimal.
  3. Fill them in, in the same unit, for example 0.07 and 5 for grams.
  4. Connect them to Amount per kg of body weight and Serving size in the Dose calculator block.

For the container size, the easiest way is the variant weight: set each variant’s weight to the net weight of its container, and turn on Use each variant’s weight as the container size. See Dose calculator.

What you see Why What to do
A row is missing on a product The product has no value for that field Fill in the field on the product
The field is not in the list when you connect The field’s type does not fit the setting, or it was made for another resource, such as variants Make a product field of the type in the table above
The facts panel shows one long row The field is a single value, not a list Make a list field, or type the rows as a bulleted list
The calculator shows nothing Amount per kg of body weight is empty for this product Fill in the field, or type a number