Is there a way to force a value in metafield?

Is there a way to force a value in metafield?

rattlesnakeMT
Shopify Partner
27 2 1

So the problem is that I'm trying to update a metafield value via webservice on a product. If the metafield has a value, I can update it, etc. But if the metafield is 'null', I cannot retrieve gid of the metafield - shows null value instead of the gid, so I can't update it.

 

Can I force a value requirement if I'm managing a product (ie: new product created, there is a value)?

Can I add a default value so it will at least have some value for that metafield?

Can I add a default value via API without Metafield GID?

The only option I can see now, is to edit every product and add '0' to the metafield. And, it's not scalable since I might forget to do that with a new product addition in the future.

 

Hank D
Replies 0 (0)