Update product metafield with metaobject entry through Shopify flow

Solved

Update product metafield with metaobject entry through Shopify flow

eCommBadassery
Shopify Partner
5 0 0

I'm hoping to use flow to update a metaobject reference metafield when new products are added through Shopify flow. Is this possible?

 

Doesn't seem to be a clear way to select a specific metaobject entry. 

Jessica
eCommerce & Email Marketing Strategist
eCommerce Badassery
Accepted Solution (1)
paul_n
Shopify Staff
1426 156 330

This is an accepted solution.

Since this is a small set of them, you can hard-code the entries into the metafield. I think you would use the Update product metafield action, and choose "Metaobject" as the type. In the value field, you would enter something like: gid://shopify/Metaobject/123. Be careful to avoid newlines/spaces/etc. The ID for your metaobject can be found in the URL of the entry (just replace that 123 part). Make sure you enter the right namespace and key as well.

Paul_N | Flow Product Manager @ Shopify
- Finding Flow useful? Leave us a review
- Need Flow help? Check out our help docs.
- Building for Flow? Check out Flow's dev docs.

View solution in original post

Replies 8 (8)

Tony-BEMEApps
Shopify Partner
16 1 7

Hi ECommBadassery,

This article may help 

How to Update Product Metafield with MetaObject Entry Through Shopify Flow

Good luck

Tony

BeMEApps
SEO Apps and Community
paul_n
Shopify Staff
1426 156 330

This article appears to be "written" by AI and is incorrect.

Paul_N | Flow Product Manager @ Shopify
- Finding Flow useful? Leave us a review
- Need Flow help? Check out our help docs.
- Building for Flow? Check out Flow's dev docs.

paul_n
Shopify Staff
1426 156 330

Yes, that should be possible. I can't really describe how to do it because it depends on which resource it's access on and exactly what you want to update. If it you change it to a different metaobject, that's possible. If you want to change the Metabject itself, that is not really updating a metafield but the metaobject. It should be possible, but you would need to use Send HTTP Request currently. 

Paul_N | Flow Product Manager @ Shopify
- Finding Flow useful? Leave us a review
- Need Flow help? Check out our help docs.
- Building for Flow? Check out Flow's dev docs.
eCommBadassery
Shopify Partner
5 0 0

@paul_n  Thanks for the heads up on the article, just looked at it now and agree. 

To clarify the use case...

I have a meta object for details about what's included in the product. The entries are specific to different product types. 

Then I have a product metafield that references that metaobject

 

For product type A - I'd like to select Entry A

For product type B - I'd like to select Entry B

For product type C - I'd like to select Entry C

 

 

 

Jessica
eCommerce & Email Marketing Strategist
eCommerce Badassery
paul_n
Shopify Staff
1426 156 330

Is this a small set of products or a lot of products? 

Paul_N | Flow Product Manager @ Shopify
- Finding Flow useful? Leave us a review
- Need Flow help? Check out our help docs.
- Building for Flow? Check out Flow's dev docs.
eCommBadassery
Shopify Partner
5 0 0

@paul_n  It's a pretty small set overall and only need workflow for when she adds new products

Jessica
eCommerce & Email Marketing Strategist
eCommerce Badassery
paul_n
Shopify Staff
1426 156 330

This is an accepted solution.

Since this is a small set of them, you can hard-code the entries into the metafield. I think you would use the Update product metafield action, and choose "Metaobject" as the type. In the value field, you would enter something like: gid://shopify/Metaobject/123. Be careful to avoid newlines/spaces/etc. The ID for your metaobject can be found in the URL of the entry (just replace that 123 part). Make sure you enter the right namespace and key as well.

Paul_N | Flow Product Manager @ Shopify
- Finding Flow useful? Leave us a review
- Need Flow help? Check out our help docs.
- Building for Flow? Check out Flow's dev docs.
eCommBadassery
Shopify Partner
5 0 0

Woot woot, worked like a charm! Thanks @paul_n 

Jessica
eCommerce & Email Marketing Strategist
eCommerce Badassery