All Collections
Customer Fields
Configuration
Metafield definitions in Shopify
Metafield definitions in Shopify

Use metafield definitions to display and edit custom data directly from the Shopify admin

Kyle Weiskopf avatar
Written by Kyle Weiskopf
Updated over a week ago

Want to access your additional customer data within the Shopify admin? Now you can!

Shopify has recently released a new feature that makes it possible to view and edit custom data right inside the Shopify admin. This game-changing new feature is known as "metafield definitions".

When a customer metafield definition is pinned, Shopify will show the metafield value directly on the customer detail page in the Shopify admin. The screenshot below shows an example of what this looks like when three customer metafields have been pinned:

To learn how to pin a metafield definition, see our help center for more details:

Please visit Shopify's help center to learn more about metafield definitions:

Customer Fields' metafield definitions

Metafields storage strategy

In order to use metafield definitions the app's metafield storage strategy must be set to 'Shopify admin-compatible'. You adjust the metafield storage strategy in the app admin by going to Settings > Metafields. This is the default setting for any shop that installs the app after April 2022 and the settings are not available for shops that install after January 2024.

When 'Shopify admin-compatible' is enabled, the app will automatically create metafield definitions in Shopify for each custom data column. There are two ways to trigger the app to create metafield definitions:

  • By performing a metafields migration (this is an automated backend process that occurs when switching over from the old strategy to the new strategy).

  • By creating a new custom data column.

Definition types

It's important to note that each metafield definition must use a content type that corresponds with the respective data column type.

Normally you shouldn't need to worry about content types for definitions since the app will automatically create metafield definitions in Shopify using the proper types. However, if you come across a situation where you need to create a metafield definition manually, then you must make sure the definition is set to use the proper content type.

See the table below for a reference of the mapping between the data column types in Customer Fields and the currently supported metafield types in Shopify:

Data column type (Customer Fields)

Metafield definition type (Shopify)

single_line_text

Single line text

single_line_text_field

text

Multi-line text

multi_line_text_field

email

Single line text

single_line_text_field

phone

Single line text

single_line_text_field

list

Single line text (List)

list.single_line_text_field

date

Date

date

date_time

Date and time

date_time

integer

Number

number_integer

float

Decimal

number_decimal

file

JSON

json

boolean

True or false

boolean

group

JSON

json

group_list

JSON

json

❗Caution: DO NOT create any metafield definitions for the app's old JSON bundle (customer_fields.data). As mentioned above, you must switch to the app's new metafield strategy if you wish to use metafield definitions for individual metafield defintions.

Metafield definition errors

If the content type for a metafield definition does not match the corresponding data column type, then the app will not be able to write data to Shopify. In most cases, this would mean your customers (and your staff) will receive an error when trying to submit a Customer Fields form.

A red error message will be displayed at top of all pages in the app admin if it detects an improper metafield definition in Shopify due to a mis-match in types between the Shopify metafield definition and the app's data column type.

If you see this error message, then you must use the Shopify admin to delete the improper metafield definition(s), or archive the data column in the app. Failure to fix metafield definition errors will cause all sorts of problems when trying to use Customer Fields to create or update customer records, so it's imperative to fix any and all definition errors as soon as possible.

Technically the app does not need metafield definitions to exist in Shopify, so simply deleting the metafield definition will suffice for most use cases. That being said, if you do want to display or edit custom data directly in the Shopify admin then you'll need to recreate the metafield definitions using the proper content type. Please refer to the table above if you are unsure about which type to use.


Questions or concerns?

Please don't hesitate to reach out to our Customer Success team via chat or email and we'll be happy to assist!

Did this answer your question?