Working With Existing Metafield Data

Overview

Most Shopify stores have some data stored in metafields. Data can come from apps, or be entered manually by a store's admin. Data that is in a "defined" metafield is meant to be edited by a store's admin, while data that is not in a "defined" metafield may be for any purpose, or may be legacy data. 

Custom Fields will automatically import any existing Metafield Definitions and always make them available during editing.

In this article, we'll review how to edit existing data Custom Fields. In older versions of Custom Fields this process was handled in the Pre-Existing Metafield Wizard. That tool has been removed in favor of this system.

Vocabulary Terms & Key Concepts
Shopify uses the term Metafield Definition for fields that have been created and appear in the Shopify interface for editing. In Custom Fields, we have a similar concept called Field Configurations. A Field Configuration will sync with a Metafield Definition if one exists for a particular field. If a Metafield Definition does not exist for a field, then field is only represented in the app, and is shown as a Field Configuration within the app.

Imported Metafield Definitions are shown in green on the Configure page in the app.

Field Configurations are shown without a background color

     

Metafields & Other Metafields Tabs

When editing content in the app, two tabs are available at the top of each edit screen.

Metafields Tab
The Metafields tab contains all fields that have been defined in Shopify, or only have a Field Configuration within the app. This is where most content will be edited.

Any field in this tab is interconnected throughout the app for areas like bulk editing and theme display. It will also have field configuration settings.

Other Metafields Tab
The Other Metafields tab contains any existing metafield data associated with the item you are editing that does not have a field configuration in the app or a definition Shopify. 

Any field data that is shown in this tab is simply pulled directly from the data associated with the item that is being edited. The field is only shown while editing if there is data associated with to show. The field is not found in other areas of the app such as bulk edit or in the theme display system. 

Data within these fields will be shown for editing based on the data type. For example, if some data is stored in a metafield that uses a basic String field type in the Shopify API, the data will be editable in a text field. If some data is stored in a Color metafield type, the color picker will be shown.

Creating Field Configurations for Other Metafields in Custom Fields

Data found in the the Other Metafields tab can be turned into Field Configurations (regular fields) in the app. To do so, simply create a field with the corresponding type in the app. For example, if your store has Product Reference data on a product in the namespace and key of my_data.my_reference, create a Product Reference field under Products in the app with the same namespace and key. Once completed, the app will place the field under the Metafields tab and will show the field for bulk editing, and make it available in the Display section for use in a theme. 

Existing data shown in the Other Metafields section.

Manually creating a corresponding Product Reference field in the app by entering the namespace and key while creating a field.

Field now appears throughout the app.

Alternatively, by creating a Metafield Definition for this data in Shopify, the app will automatically import the matching Definition, which eliminates the need for this process in the app. Simply create the Definition then click on Update Definitions on the Configure Fields page in the app.