Re: Update product metafield with metaobject entry through Shopify flow

Topic summary

A user encountered an error when trying to update a product metafield with a metaobject reference through Shopify Flow. The error indicated a type mismatch: the metafield was defined as list.metaobject_reference but was being set as a single metaobject_reference.

Core Issue:

  • The user wanted to create/update metaobject entries using metaobjectUpsert and then assign the resulting metaobject ID (format: gid://shopify/Metaobject/123) to a product metafield.
  • This workflow was initially impossible because the Send Admin API request action in Shopify Flow couldn’t return data from mutations.

Resolution:

  • As of September 2024, Shopify Flow now supports returning data from the Send Admin API request action.
  • This update enables the desired workflow of capturing metaobject IDs after creation and using them in subsequent actions.
  • The feature announcement is available in the Shopify changelog.
Summarized with AI on October 31. AI used: claude-sonnet-4-5-20250929.

Hi

I am trying below but getting an error

How do I get metaobject ID as value

Mutation had user errors: “Type ‘metaobject_reference’ must be consistent with the definition’s type: ‘list.metaobject_reference’.”

{
“metafields”: [
{
“ownerId”: “{{product.id}}”,
“key”: “or_see_more_choices_”,
“namespace”:“custom”,
“type”: “metaobject_reference”,
“value”: “{{ product.vendor | downcase }}-freestanding-washing-machine”
}
]
}

Your metaobject is a list of metaobjects, which would be more like [“gid://shopify/Metaobject/123”, “gid://shopify/Metaobject/122”]

I’m not sure why you are posting a mutation here, as this is using the Update product metafield action.

I have tried both update meta field flow and mutation

none of them get value using flow like this gid://shopify/Metaobject/123 like

do u know how to get object ID using flow

I don’t know what you are asking, but it’s different enough than this that you might need to start another thread and do you best to explain what you are trying to do.

Is there any way to get the metaobject ID I am using metaobjectUpsert to create/update metaobject entries once this is saved then I want to assign that Metaobject ID gid://shopify/Metaobject/123 to the meta field this is possible

No, can’t be done yet because the Send Admin API request action doesn’t yet return data from the mutation. This is planned work and in progress.

1 Like

Thanks Paul,

Any approx ETA so I can keep an eye

Hi Paul

Any ETA on it

Hi Gary07, this is planned work and in progress but we can’t comment on an expected date given the number of priorities we’re balancing across the team.

How do we get a notification once added to the
https://changelog.shopify.com/ ?

Hi @gary07 , the Send Admin API request action can now return data as of September 2024: https://changelog.shopify.com/posts/flow-use-returned-data-from-send-admin-api-request-action