Metafields

You can update product and variant metafields based on the supplier feed.

To be able to add a metafield in the Stockeo automation, you need to add a metafield definition in the Custom Data section of your store settings first.

Update metafield single value

Add a Metafield field in the Data Mapping section. Select the metafield to be updated, and specify which column/node contains a corresponding value in the supplier feed.

Add Metafield in the Stockeo automation animated
Add metafield in the Stockeo automation

For example, if you want to store all of the below properties in your store:

<Item>
<ID>
<![CDATA[ ARC-18126-1-01 ]]>
</ID>
<Width>8.00</Width>
<Size>
<![CDATA[ 18.0 İnch ]]>
</Size>
<Hole>5</Hole>
<PCD>100</PCD>
<Offset>34</Offset>
<Bore>73.1</Bore>
<Stok>15</Stok>
</Item>

Use the following settings in your Data Mapping section:

Data Mapping section of Stockeo automation with added metafields annotated
Data Mapping section of Stockeo automation with added metafields

It may be the case that the values you want to store in the metafield are nested in the param node, while the property name and its value, are in separate nodes.

<item>
  <param>
    <name>Brand</name>
    <value>Samsung</value>
  </param>
  <param>
    <name>Model</name>
    <value>UE55TU8500UXXU</value>
  </param>
  <param>
    <name>Screen Size</name>
    <value>55 inches</value>
  </param>
  <param>
    <name>Resolution</name>
    <value>4K Ultra HD</value>
  </param>
  <param>
    <name>Smart TV</name>
    <value>Yes</value>
  </param>
</item>

To get them you need to use a Liquid formula in the Mapping field with the where and map filters:

{{ param | where: "name", "Brand" | map: "value" }}

In this code, param refers to a node that contains other nodes with the property name and its value. "name" is the name of the node that contains the "Brand" property, while "value" is the information to be stored in the metafield.

For the feed above use the following settings:

How to get the value to be stored in the metafield from the param node
Get the value to be stored in the metafield from the param node

A special use case for metafields is to employ one of them as the product/variant identifier instead of the SKU field.

Check out how to use a variant metafield to recognize a product from the feed.

Update metafield lists

Stockeo enables you to update metafield lists that allow storing multiple values in a single metafield.

Stockeo can only overwrite a current metafield list. There is no mode to add new items and keep the old ones.

To pass a list of values to Shopify correctly, ensure commas separate values:

Commas separated values to be passed as a metafield list

If a different separator is used, a semicolon, for instance, add a Liquid formula to convert it to commas:

{{ Ingredients | replace: ";","," }}
Replace semicolons with commas using Liquid

You can also use Liquid to pass values from multiple columns/fields:

Values to be passed included in separate columns
Use Liquid to pass values from different columns

To assign a fixed metafield list of values for each variant, use another Liquid formula:

Use Liquid to pass a fixed values list

Metaobjects

Stockeo supports importing data into metafields of type metaobject. When processing your feed, Stockeo matches incoming values to existing metaobject entries in your store using either the display name or the handle. Please note that matching is case-sensitive.

Stockeo does not create new metaobjects entries. If a value in your feed doesn’t match an existing metaobject, it will be skipped.


Supported metafields types

Stockeo enables you to update values for the following types of metafields:

Single values

  • Boolean

  • Color

  • Data

  • Date and Time

  • Decimal

  • Integer

  • Metaobject

  • Multi-line text

  • Single-line text

  • URL

Lists of values

  • Single-line texts

  • Decimals

  • Integers

  • URLs

Last updated