All things Shopify and commerce
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
Hello!
I have thousands of products to import from a script that takes product data from a prepared JSON file and sets up the Shopify import CSV. However, the issue arises when I try to include single-line text metafield data(seen in photos). It is easy to do manually in Shopify, but it isn't feasible with the amount of products I have. In the product export CSV, it seems easy - just '\n' in the String that is put in one cell but it doesn't work when importing the product. The error I am encountering is as follows: "Validation failed: Owner subtype does not match the metafield definition's constraints."
Hi Toms,
It sounds like a mismatch between how Shopify is expecting the metafield data to be formatted, and how your script is preparing it. Without seeing your script it's hard to know what the issue is, but "Owner" in this context would be the object class that the metafield belongs to, e.g., "Product", or "Customer".
More on metafield constraints here: https://shopify.dev/docs/apps/build/custom-data/metafields/conditional-metafield-definitions
Don