Help me fix my metafield conditional statement issue

I have added this conditional statment to my product.json file to hide blank metafields

“a2465fbd-ed30-43ec-b8a1-4116d9023fe9”: {
“type”: “text”,
“settings”: {
“text”: “{% if product.metafields.custom.dimensions.value != blank %}

Dimensions : {{ product.metafields.custom.dimensions.value }}

{% endif %}”
}
},

This is my error:

Unable to update the file

  • Setting ‘text’ can’t include Liquid syntax (‘{{’, ‘}}’, ‘{%’ or ‘%}’) without valid dynamic sources.

I have checked the JSON in https://codebeautify.org and it says its valid?

Any ideas please?

@RobMoore007

can you please create meta filed in Liuide code not a json

No Im using the Shopify 2.0 functionality to create and insert metafields

hi @RobMoore007 ,

did you found any solution ?

kindly share