HowTo: Use Shopify References Metafields type

Modified on Tue, 7 Apr at 12:34 PM

Working with metaobjects and reference fields in Shopify can require more focus at first. If you send the incorrect value format, Shopify will either reject the request or silently fail to populate the field.


This guide explains what Shopify expects, how to format values correctly, and a practical workaround that makes integrations much easier.


TABLE OF CONTENTS


1. How Shopify Stores References

In Shopify, reference fields only store GIDs (Global IDs). NOT plain IDs or text.

A Shopify GID looks like this:

gid://shopify/ObjectType/ID

Examples:

gid://shopify/Product/123456789 
gid://shopify/Collection/987654321 
gid://shopify/Metaobject/456123789 
gid://shopify/ProductVariant/123987456

These identifiers tell Shopify both the object type and the ID.


Find the Object ID in the Shopify Admin

You can retrieve the ID of most Shopify objects directly from the admin URL.


Example: Collection ID

Open a collection in Shopify Admin:

https://admin.shopify.com/store/your-store/collections/987654321

Reference value:

gid://shopify/Collection/987654321

Find Metaobject Entry IDs

Metaobjects also have IDs that appear in the admin interface.

  1. Go to Content → Metaobjects.

  2. Open the desired metaobject entry.

  3. Check the URL.


Example:

https://admin.shopify.com/store/your-store/content/metaobjects/faq_item/456123789

Reference value:

gid://shopify/Metaobject/456123789

2. Use the Correct Value Format in Valigara

Once you have the ID, convert it into a Shopify GID format, and store it in the relevant product field. 


ObjectExample value
Productgid://shopify/Product/123456789
Collectiongid://shopify/Collection/987654321
Variantgid://shopify/ProductVariant/111222333
Metaobjectgid://shopify/Metaobject/456123789

These values can then be used in reference fields or integrations


Pro Tip: Use Select Fields for Human-Readable Values

A practical workaround is to use a Select field as a translation layer, to use human-facing values in Valigara. 


  1. In Additional Fields, create a Select single field.

  2. Add all the human-readable options (f.i. "Green, Red, Blue" or "Evening Collection, Bridal Collection, Classical Collection")

  3. Uncheck “Same values for all channels”

  4. For each value, enter the correct Shopify reference value, f.i. gid://shopify/Metaobject/123



This way:

  • Users see readable names in Valigara.

  • Shopify receives the correct reference format.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article