Core Issue:
Developers are struggling to access metaobject values stored in product metafields using Liquid, with initial attempts returning only GID reference URLs instead of actual field values.
Working Solutions:
For metafields containing metaobject lists:
{% assign items = product.metafields.custom.namespace.value %}
{% for item in items %}
{{ item.field_name.value }}
{% endfor %}
For shop-level metaobjects (all entries):
{% assign icons = shop.metaobjects.icon.values %}
{% for icon in icons %}
{{ icon.title }}
{% endfor %}
Key Distinctions:
Use product.metafields.custom.key.value when metafield references specific metaobjects selected per product
Use shop.metaobjects.type.values to access all metaobject entries globally
Access nested fields with .field_name.value syntax
Rich Text Handling:
For rich text metaobject fields, use:
Status:
Resolved through community collaboration. Multiple users confirmed working implementations. Documentation gaps noted as a recurring frustration during the feature’s early rollout.
Summarized with AI on October 30.
AI used: claude-sonnet-4-5-20250929.
My store has been given access to metaobjects, and so I’ve started using it and setup a few metaobjects that I want to use in the metafields for products and variants. But I don’t quite get how I can access the values of the meta object via the metafields?
I thought maybe something like this would make sense:
{% for metaobject in product.metafields.namespace.key %}
{{ metaobject.field.value }}
{% endfor %}
Appreciate the correct way to do this, and updating the Liquid API documentation would be very helpful.
Is there no one that can answer this? It would be poor to add such a nice way of storing information without the possibility to access the information in the frontend…?
I’ve read this documentation. But I can’t see how it gives information on how to access values from metaobjects that are defined in metafields in example of a product. Might be something I’ve overlooked though…
Using @LazaEAG example worked for a metaobject. But I wanted to use the metaobject as a database to store all the colour swatches for different products and select which ones I wanted to show on which product. The code above output EVERY colour swatch in the metaobject. So I made a metafield using the metaobject I had created as the content type.
That way for each product I can select which colour swatches from the metaobject that I want to display.
Modifying the code slightly for metafield:
{% assign swatches = product.metafields.custom.available_colours_swatches.value %}
{% for swatch in swatches %}
{{ swatch.name.value }}
{% endfor %}
First, thank you for sharing examples. And you are right, my example was some global case, I used it for one section with icons and as part of another object that has the same icons. Like you said for the product is slightly different.
Thank YOU for pointing me in the right direction. Was frustrated by the lack of documentation and having no luck up until then executing what I needed to do
Hi all, I am not sure how this needs to work in other areas of shopify, such as collection page.
Basically I want to create a carousel that populates data from each entry inside of the metaobject created. I followed the above sets, but having 0 success. Below is the following code I have implemented.
You should try to debug and see where the issue appears.
So first check if {{ collection.metafields.custom.collection_filter.values | json }} is not empty. If it is try with {{ collection.metafields.custom.collection_filter.value | json }} so without “s” at the end.
Next step print {{ pfilter | json }} and also the try with {{ pfilters.collectiontitle }}
@LazaEAG thanks for the reply. I followed your steps above and it seems the only one that returns data is {{ collection.metafields.custom.collection_filter.value | json }}
This is what it returns: {“collectionimage”:“gid://shopify/MediaImage/33168175333688”,“collectiontitle”:“Kitchen”}
This returns: {{ collection.metafields.custom.collection_filter.values | json }} null
This returns: {{ pfilter | json }} null
This returns: {{ pfilters.collectiontitle }} nothing
Hi guys, I’m having a similar issues and don’t understand what I’m doing wrong.
I have a customer metafield containing list of metaobjects. The metafield has namespace custom and key license_new and it references a metaobject of type license which has 2 fields:
reference_product: reference to the product.
license_files: a list of generic files.
I want to display the list of metaobjects, specifically a link to the reference_product and links to download the related license_files, in the customer account page. I’m attempting to do so using
{% assign licenses = customer.metafields.custom.license_new.value %}
{% for license in licenses %}
{{ license.reference_product.value }}
{% endfor %}
This doesn’t seem to work and I don’t understand why.
I tried a similar approach with a simpler metafiled of key licenses that only contains a list of generic files. If I try to display the files IDs by doing
{% assign licenses = customer.metafields.custom.licenses.value %}
{% for license in licenses %}
{{ license.id }}
{% endfor %}