EZ Exporter Metafields

You can find the Metafields option in the Data Settings.

Export Shopify Metafields with EZ Exporter by Highview Apps

There may be cases where you'd want to include custom fields stored in Shopify Metafields in your reports. A metafield can be attached to a resource such as an order, product, product variant, or customer.

For example, for some products you may have an Amazon ASIN metafield attached to them if you also sell your products on the Amazon Marketplace. You may also use metafields to store additional product information such as the manufacturer, model, and item condition.

There are also some Shopify data that can only be retrieved via metafields. For example, the "SEO Description" field in the product data is stored in the Product Metafield API using the key "description_tag".

With EZ Exporter, we've provided an option for you to include them. Simply specify the metafield key (without the namespace) and your desired column name.

Advanced Uses

There may be cases where you need to combine metafield values with other built-in Shopify field values in a Custom Field. You may also want to manipulate the metafield value on export using a Calculated Field.

To reference metafields in Custom Fields or Calculated Fields, you'll need to use the full field name like this:

{{ metafields.<namespace>.<key> }}

Replace the <namespace> and <key> parts with the actual namespace and key like this:

{{ metafields.global.title_tag }}

Note that when using Calculated Fields, the metafields values will be pulled as string/text data type by default.  So if you need to perform arithmetic operations using the metafield value, you'll need to coerce it to a float or integer data type.  For example:

float({{ metafields.custom.additional_fee }}) / 100

You can use the following functions for type coercion:

  • float() - set data type to a float/decimal
  • int() - set data type to an integer
  • str() - set data type to a string/text
  • load_json_data() - convert a JSON string to a list or dict type (i.e. deserialize it so we can perform operations such as key/value lookups, slicing, and filtering against the data)

For your reference, below are the available metafield field names that you can reference in the Custom Fields and Calculated Fields which vary slightly depending on the type of export.

Order Export

  • Order Metafields: {{ metafields.<namespace>.<key> }}
  • Product Metafields: {{ line_items.product.metafields.<namespace>.<key> }}
  • Variant Metafields: {{ line_items.variant.metafields.<namespace>.<key> }}
  • Customer Metafields: {{ customer.metafields.<namespace>.<key> }}

Draft Order Export

  • Draft Order Metafields: {{ metafields.<namespace>.<key> }}
  • Product Metafields: {{ line_items.product.metafields.<namespace>.<key> }}
  • Variant Metafields: {{ line_items.variant.metafields.<namespace>.<key> }}
  • Customer Metafields: {{ customer.metafields.<namespace>.<key> }}

Product Export

  • Product Metafields: {{ metafields.<namespace>.<key> }}
  • Variant Metafields: {{ variants.metafields.<namespace>.<key> }}

Customer Export

  • Customer Metafields: {{ metafields.<namespace>.<key> }}

Collection Export

  • Collection Metafields: {{ metafields.<namespace>.<key> }}

Related Articles:


App: EZ Exporter

Tags: advanced features