A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
Hi there, I had added metafield for a product using API but it doesnot show while editing product. There is no data on Product Definition of metafield as well. I could not check whether my metafields are added or not. Doesnot it display in product edition as we can while adding metafields manually from settings page.
Thanks Jazz-Jay for your quick response, It was under metafields without definition, I don't see any options there to make it available in product admin page
Hi @santosh13,
Thanks for reaching out. A couple things I thought I'd touch on.
1. If you want to see the Metafield you created via the REST API:
Click on "Metafields without a definition" similar to how you did in your previous message.
2. It looks like the 'key' in your Metafield ("Image 1 Path") has invalid characters. It appears to have spaces in it, which is why you're unable to create a Metafield definition that doesn't conform to the documented allowed characters. See here and here which document the allowed characters (alphanumerics, hyphens, underscores, and periods). You won't be able to modify the key as mentioned by the popup window in your screenshot above. You would need to create a new Metafield with namespace & key, with only allowed characters.
You could create your Metafield with the REST API as you did before, just note that the API as you used it, doesn't create a Metafield definition, just a Metafield with an assigned value. You could create your Metafield definition from your store's Admin in the "Definitions" tab on the same page you screen shared above, just as in the link Jazz-Jay shared above.
Hope this helps
To learn more visit the Shopify Help Center or the Community Blog.
A possible reason is that the theme you're using does not include a text field for metafields by default.