Shopify Python Library - Set metafield value to blank

Shopify Partner
1 0 0

I'm trying to, using the Shopify Python library (which isn't that well documented), set a Metafield value that's currently a type single-line-text to either "" or Nil.


I've tried these solutions, and neither of them worked. My metafield definition will update to any other value I submit, but if I try submitting "" or None as the value, it will not change.

#Example code included. I removed parts that do not need to be altered, like creating the customer object etc.

def add_order_metafield(tag, value):
    metafield = shopify.Metafield({
    'key': tag,
    'value': value,
    return metafield

#doesn't work
customer.add_metafield(add_order_metafield('date', ''))

#doesn't work
customer.add_metafield(add_order_metafield('date', None))

#works as intended
customer.add_metafield(add_order_metafield('date', "None"))

 Any advice here would be helpful.

Replies 0 (0)