# Cannot fetch metafield values

**URL:** <https://community.shopify.dev/t/cannot-fetch-metafield-values/10212>\
**Category:** Online Store and Theme Development\
**Tags:** liquid\
**Created:** [March 6, 2025, 10:32am UTC](https://community.shopify.dev/t/cannot-fetch-metafield-values/10212 "2025-03-06T10:32:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Balvan](https://avatars.discourse-cdn.com/v4/letter/b/74df32/32.png) [@Balvan](https://community.shopify.dev/u/Balvan)\
**Post date:** [March 6, 2025, 10:32am UTC](https://community.shopify.dev/t/cannot-fetch-metafield-values/10212/1 "2025-03-06T10:32:55Z")

</div>

The metafield is type Product (list of products).  
I have tried {% for product in product.metafields.custom.upsell\_styled\_with. **values** %} (plural) too, but still no output.  
Here are 3 examples of different outputs. Actually, first 2 have outputs, but the 3rd doesn’t even run the loop, as there is no **p** tag in third case:

 ![image](https://global.discourse-cdn.com/shopifycommunity/original/2X/8/87977264f0845c6d08b3baa8d9ec03e277fbb6ba.png)

Output:

 ![image](https://global.discourse-cdn.com/shopifycommunity/original/2X/4/44b8606eb9d605891ae123e3f2dd4962d1ab73bc.png)

---

<div class="post-metadata">

**Author:** ![Eugene\_Kasimov](https://sea1.discourse-cdn.com/shopifycommunity/user_avatar/community.shopify.dev/eugene_kasimov/32/4565_2.png) [@Eugene\_Kasimov](https://community.shopify.dev/u/Eugene_Kasimov)\
**Post date:** [March 6, 2025, 5:52pm UTC](https://community.shopify.dev/t/cannot-fetch-metafield-values/10212/2 "2025-03-06T17:52:13Z")

</div>

Hi @Balvan

I think the reason you don’t see any output in your `for loop`, because you are trying to iterate through a single value.

Your variable `styled_with_products` is not an abject.

by doing this

```Liquid
{% assign styled_with_products = product.metafields.custom.upsell_styled_with.value

```

you just say let’s store a single value in `styled_with_products`.

Does it make sense?

---

<div class="post-metadata">

**Author:** ![curzey](https://sea1.discourse-cdn.com/shopifycommunity/user_avatar/community.shopify.dev/curzey/32/7190_2.png) [@curzey](https://community.shopify.dev/u/curzey)\
**Post date:** [March 6, 2025, 8:39pm UTC](https://community.shopify.dev/t/cannot-fetch-metafield-values/10212/3 "2025-03-06T20:39:18Z")

</div>

I think @Eugene_Kasimov is right.

This works for me:

```auto
{% for product in product.metafields.custom.bundle_products.value %}
   ...{{ product.title }}...
{%- endfor -%}

```

which is identical - just without assigning it first.

---

<div class="post-metadata">

**Author:** ![Balvan](https://avatars.discourse-cdn.com/v4/letter/b/74df32/32.png) [@Balvan](https://community.shopify.dev/u/Balvan)\
**Post date:** [March 7, 2025, 2:16pm UTC](https://community.shopify.dev/t/cannot-fetch-metafield-values/10212/4 "2025-03-07T14:16:21Z")

</div>

@curzey @Eugene_Kasimov  
The client has actually chosen archived products in the metafield 😓 so that was the issue.  
Thank you for your suggestions!

---

<div class="post-metadata">

**Author:** ![curzey](https://sea1.discourse-cdn.com/shopifycommunity/user_avatar/community.shopify.dev/curzey/32/7190_2.png) [@curzey](https://community.shopify.dev/u/curzey)\
**Post date:** [March 7, 2025, 3:01pm UTC](https://community.shopify.dev/t/cannot-fetch-metafield-values/10212/5 "2025-03-07T15:01:56Z")

</div>

That’s a struggle.

Archived products and b2b catalogs where not all customers has access to specific products.
