Hello, I want to automate the Katecorgi metafields by writing a product description, and then I want the system to extract the values for the metafields from the description. I keep geting errors.
Topic summary
A user is attempting to automate metafield population in Shopify by extracting values from product descriptions using Flow. The goal is to parse text like âGlass: Mineral glassâ from descriptions and automatically populate corresponding metafields.
Key Technical Challenge:
The metafield uses a metaobject reference (not simple text), requiring updates via the Admin APIâs metaobjectUpdate mutation rather than standard metafield actions.
Progress & Issues:
- Initial attempts failed due to empty value fields and incorrect mutation syntax
- User encountered variable validation errors when using
metaobjectUpdate - After troubleshooting the field key (changed from âtypâ to âglasâ), the mutation executes without errors but values donât populate in the product metafieldâonly in the metaobject itself under Content
- Switching to multi-line text fields (simpler approach) isnât viable because the metafield is used for product filtering, and 400+ products already have manually entered data
Current Status:
The discussion remains unresolved. The user needs a solution for automatically updating metaobject-based metafields while preserving existing data structure. String parsing (via Run Code action in JavaScript or Liquid) was suggested but implementation details for metaobject references are still unclear.
Itâs not clear what you want to do here and why youâve left the value field empty when updating a metafield.
I want to write a product description. For example:
Technical details
Glass: Mineral glass
When the system detects the value âMineral glassâ in the description, I want it to automatically extract that value and place it in the metafield for âtype of glassâ.
Could you still help me? this is the errors. I also dont know what to put
in the value. i have already created a metafield and the values for that
metafield[image: SkaĚrmavbild 2025-04-24 kl. 23.13.36.png]
[image: SkaĚrmavbild 2025-04-24 kl. 23.13.58.png]
no image came through your post.
If itâs in the description, you need to do string parsing on the description. It really depends on how consistent your descriptions are, but probably I would use Run code on that as JavaScript has more tools for string parsing then Liquid. But Liquid might work as well.
Your metafield is a metaobject reference. You cannot change the values in a metaobject by updating the product metafield. Instead you would need to update the metaobject.
To do that, you would use âSend Admin API requestâ with the âmetaobjectUpdateâ mutation. Youâll need to set the JSON in that update.
thanks for the help but i still get some errors. I tried with the metaobjectupdate and got this errors "Mutation had errors: âVariable $id of type ID! was provided invalid valueâ, âVariable $metaobject of type MetaobjectUpdateInput! was provided invalid valueâ {
âqueryâ: âmutation metaobjectUpdate($input: MetaobjectUpdateInput!) { metaobjectUpdate(input: $input) { metaobject { id } userErrors { field message } } }â,
âvariablesâ: {
âinputâ: {
âidâ: âgid://shopify/Metaobject/170755064149â,
âhandleâ: âkristallglasâ,
âfieldsâ: [
{
âkeyâ: âtypâ,
âvalueâ: âKristallglasâ
}
],
âcapabilitiesâ: {
âpublishableâ: {
âstatusâ: âACTIVEâ
},
âonlineStoreâ: {
âtemplateSuffixâ: ââ
}
},
âredirectNewHandleâ: false
}
}
}
It appears you are including fields that you really donât need to update so itâs not clear which field this error is complaining about. Assuming that itâs they value field for your metaobject, you need to share more details about your metafield, specifically the types of each field.
hello could you find the problem?
Your key for that field is either âglasâ or âglas.glasâ not âtypâ
As you can see in the SC everything works and i get no errors anymore but value in the metafield does not fills. the code: {
âidâ: âgid://shopify/Metaobject/170755064149â,
âmetaobjectâ: {
âhandleâ: âkristallglasâ,
âfieldsâ: [
{
âkeyâ: âglasâ,
âvalueâ: âkristallglasâ
}
],
âcapabilitiesâ: {
âpublishableâ: {
âstatusâ: âACTIVEâ
}
},
âredirectNewHandleâ: false
}
}
You arenât updating a product metafield but a metaobject. If you go to âContentâ in the Admin you should see what you updated.
So should i set a metafieldsSet mutation or please what should i do? Im useing a categori metafilds for my products
I donât know because itâs unclear why you are using a metaobject at all if you just want a description. If thatâs all you need, then create a product metafield that is multi-line text and use the âUpdate product metafieldâ action on it.
i think i got it thanks








