Ecommerce Shopify WordPress Discussion

how to access values in array of object in custom liquid shopify, this array of object is added in metafields of product

I have added an array of object in product metafields like below: const response = await client.query({ data: { "query": `mutation updateProductMetafields($input: ProductInput!) { productUpdate(input: $input) { product { id metafields(first: 3) { edges { node { id namespace key value } } } } userErrors { message field } } }`, "variables": { "input": { "metafields": [ { "namespace": "my_field", "key": "faq", "type": "json", "value": "{\"objects\": [{\"question\": \"test 1\", \"answer\": \"yes I'm test 1\"}, {\"question\": \"test 2\", \"answer\": \"yes I'm test 2\"}] }" } ], "id": "gid://shopify/Product/435353534" } }, } }); Now I want to access these in my custom liquid, I tried accessing it but nothing is shown {% assign product_metafields = product.metafields.my_field.faq -%} {% for object in product_metafields.objects %} <p>Question: {{ object.question }}</p> <p>Answer: {{ object.answer }}</p> {% endfor %} Kindly tell me where the issue is.
Our products

The help you need, when you need it

App by Turbo Engine

3 apps • 5.0 average rating

Turbosify Speed Booster

5.0 (7)
Get better conversions by optimizing shopify store Google page speed Installed

Turbosify Translator for Wordpress Woocommerce

5.0 (74) Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no No technical required

Grow your business here

Whether you want to sell products down the street or around the world, we have all the tools you need.