Expose Existing Metafields to Custom Fields

Custom Fields allows you to manage any Metafield, even if it wasn't created by our app. 

We always recommend using our structured field types rather than simple "raw" Metafields, but sometimes that's not practical, for instance, if your theme is already built using data stored in a namespace outside of custom_fields. For example, you may have made fields using another app and placed data in a namespace like product.metafields.c_f.myfield and now you want to use the app to manage that existing data.

Setup Overview

Other apps use one of two ways to set up fields, but Custom Fields introduces a new (faster) way.

Old Method 1

You enter your namespace, your key and set the field type every time you want to store a data point, over and over again. Whatever data has been saved in any metafield is shown to you all the time when editing the object.

Old Method 2

You create a reusable form field one time and the form field is always available, when it has data, and when it doesn't. You do this by entering the namespace, key and field type for each field you want to manage, one by one during an initial setup. This option is available in Custom Fields as well, by visiting the Create Field page and changing the namespace and key as you create a new field.

The Pre-Existing Metafield Setup Wizard

In Custom Fields, you'll simply run a setup wizard that detects your existing data and helps you set up your fields with just a few clicks.

Pre-Existing Metafield Wizard 

To get started with the Wizard, visit a product or other object. The only criteria for selecting this object are that you want to pick an item that has data attached to that you want to manage in the app. 

If you don't have any fields set up in our app at all, you'll see this option on any object you try to edit it in the app.

Screenshot_2019-11-07_14.16.04.png

If you do have existing fields set up in the app, you'll see this message at the bottom of the edit screen.

Screenshot_2019-11-07_14.06.59.png

Both options take you to the same interface.

Screenshot_2019-11-07_14.22.10.png

In our example, the product we chose has data in two namespaces, c_f, and product_data. The Pre-Existing Metafield Wizard allows you to set up all fields for a namespace at once. We'll start with the c_f namespace by clicking on "Create new form fields for data in the c_f namespace".

Screenshot_2019-11-07_14.25.00.png

Now we'll set the widget type for each field. In our case, we just want to set these as text fields and then save the form.

Screenshot_2019-11-07_14.26.30.png

Back on the product edit screen that we started from, we can now see the new form fields and edit the existing data.

Note that these fields are also identified in the interface by their namespace and key on the right side of the form field.

Screenshot_2019-11-07_14.27.35.png

You can now edit your field data on any product and the form fields will persist throughout the application.

Screenshot_2019-11-07_14.30.33.png

Additional Configuration

You may now rearrange your fields on the form, or edit the field setup and add a description or change other settings. Visit the Configure Fields page to perform these tasks.

Screenshot_2019-11-07_14.32.38.png

Additional Resources and Information

Custom Fields: Using Custom Fields Beyond Products - This section goes through different uses of Custom Fields other than product pages.

Shopify: The Metafield Object Documentation - This Shopify article goes through what metafields are and how they work with Shopify.