Conversations about creating, managing, and using metafields to store and retrieve custom data for apps and themes.
How do you delete a metafield in Ruby on Rails?
I got how to Add a metafield and update, but seem to not be able to delete. Has anyone does this before?
Terry
Hi Terry,
you can delete a Metafield by making a DELETE request to /admin/metafields/*********.json. Here are the docs http://docs.shopify.com/api/metafield#destroy. If you are using our ruby API gem then you can call destroy() on the object and it should delete it.
To learn more visit the Shopify Help Center or the Community Blog.
How would this be done using the Python package?
When you create a metafield you will be returned an resource with an ID. You can then just simply delete the resource.
metafield = ShopifyAPI::Metafield.find(SOME_META_ID) metafield.destroy
Chris | Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit the Shopify Help Center or the Shopify Blog
Chris Thank You!