Can't clear a property value from a contact


#1

When fetching a contact, I get the properties for each user that have values (and that I requested). So if we have a dozen contact properties but only two have values for a particular contact, I only get those two property values back in the contact’s data.

But once set, a property can be edited but never removed from that contact. Setting the value to null or “” are successful, but querying that contact again shows the property with a value of “”.

So submitting this:
“properties”: {
“address”: {
“value”: null
},

Still returns this when the contact is later downloaded:
“properties”: {
“address”: {
“value”: “”
},

How do I clean up these values and return the properties to the unset state?


#2

Hi @apiguy,

It’s not currently possible to fully ‘clear’ these properties, since they still have an associated version history. If you need to get contact records without these properties cluttering up the response, you can request particular contact properties explicitly using the property parameter:


#3

Interesting. Thanks for your response. I can definitely see where you would need the empty value in the versioned values at least.

All of the historical values were empty strings caused by setting the value to null instead of omitting the property from my update request. I’ve fixed my serializer so that will not happen anymore.

I wonder if the API should ignore a null assignment to a property that has yet to be set? I guess it is a bit of an edge case.


#4

Hi @apiguy,

I can certainly bring it up to the team, though I’m not sure exactly how we’d want to handle that case. Thanks for adding context here.