Personalized checkout and custom promotions with Shopify Scripts
I am trying to update product meta fields using a python script via the Shopify API. I have tried so many things and made sure that the meta fields exist, used the correct name space and keys in the code. But they are somehow invisible to the code. The code retrieves other meta fields, but not the ones I want to update. The difference between the two groups of meta fields is that, the ones the code retrieves are created programmatically and are of the type multi line text and the others are also created by a python program but are of the type rich text field. Here is the code snippet that tries to extract meta fields:
Dear Emmyshopy,
I have changed from the rest API to the graphql API. Now I am able to access the product meta fields. But I am stuck with updating the meta fields. I keep on getting invalid json value for the metafields value. I have tried escape html, json.dumps() and numerous other ways to pass the metafield values, but I couldn't get a success. Some times I get schema error. The documentatiin says we have to pass the values as a string, but even though I have a string value in python code, graphql some how doesn't recognise it as a string. Do you think you can help with that? Any tips from any one who encountered this and solved it?
Thanks in advance.
Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025Discover opportunities to improve SEO with new guidance available from Shopify’s growth...
By Jacqui May 1, 2025