cancel
Showing results for 
Search instead for 
Did you mean: 

API Question - How do I delete data from the 15 Custom Fields?

Highlighted
Member

API Question - How do I delete data from the 15 Custom Fields?

I recently found out about the 15 field limit for custom fields.

 

I now need to re-purpose some previously used fields (4 of the 15).

 

Apparantly, there is a known defect that prevents custom fields from being deleted from the UI.

 

There is also a know defect for importing a .csv with blank, "", or NULL field values to clear historical data.

 

Is there a way to do this from the API?

Tags (1)
4 REPLIES 4
Moderator

Re: API Question - How do I delete data from the 15 Custom Fields?

I checked with our Contact Management dev team regarding the defects you mentioned.  Unfortunately, the team is not aware of any issues with deleting Custom Fields (please note, this is currently only supported through the UI as not all our customers have access to this feature) or with clearing out content through the bulk import. 

 

Will have our team double check the clearing of contacts through the bulk import API as we're actually doing some testing enhancements on that specific endpoint right now.  If we find anything, we'll make sure to update here.  However, assuming we don't find anything new, you should be able to import through our API to fully update the contact record, including clearing out information on fields which are left blank. 

Dave Berard
Senior Product Manager, Constant Contact
Moderator

Re: API Question - How do I delete data from the 15 Custom Fields?

Thanks for sharing the extra details in a PM.  I looked up your support interactions and spoke with our Tier 3 group.  Definitely looks like you're running into a product defect on the delete custom fields.  I escallated the defect through our Contact Management product group to see what is going on.  I apologize for the incorrect answer I gave earlier.  This isn't an API defect as you can't manage Custom Fields through the API today but I will work on making sure that the issue you ran into is being looked at.

 

My QE team did some testing regarding importing Contacts through our bulk import API.  I do have some bad news to share on that front.  In our old Contact Management system, blanks did overwrite data and clear out custom fields.  In our new Contact Management system, this is no longer true.  In order to prevent accidentally clearing out data, the new Contact Management system ignores blanks or nulls in import data and keeps the original data.  There are two workarounds for this:

 

1. Update each Contact individually using a PUT in the API on that Contact.  This does respect blank strings and nulls and will overwrite data.  Unfortunately, this must be done on a one contact at a time basis.

2. When importing your bulk data, use a dummy value instead, such as the actual word "NULL" to show that the data is not valid.  While clearly not blanking out the values, it could accomplish a task of clearing out data that shouldn't show anymore.

 

After talking with the Product Management team for Contacts, they were curious what your use case is for wanting to blank out fields.  They were very open to the idea of adding the ability to overwrite data fields with blank data in the API, while in the UI they are more reticent due to accidental imports from customers causing data to be cleared.  However, in order to prioritize this work effectively they wanted to understand more about what our developers would like to use it for.  Any chance you can share information about what you are looking to do?  Feel free to PM me again if you don't want to share that information publicly.

Dave Berard
Senior Product Manager, Constant Contact
All Star

Re: API Question - How do I delete data from the 15 Custom Fields?

Has the ability to update a custom field through the API been implemented? We use a custom_field_NN to update a clients payment dates or payment amounts. If they already made a payment we need to NULL that value.

Next question if we use e.g. <IfPropertyExists name="Subscriber.CustomText15"> element, will the text within this element be shown if the the value of CustomText15 isNull or empty?

Moderator

Re: API Question - How do I delete data from the 15 Custom Fields?

Hello BobbyK87,

 

Using our current API which is v2 you can only use custom field names that are formatted like custom_field_1-15. Our documentation for this is listed here. (https://developer.constantcontact.com/docs/contacts-api/contacts-resource.html?method=PUT)

 

An example of how that would be formatted. 

"custom_fields": [{
            "name": "CustomField15",
            "label": "CustomField15",
            "value": "test"
}]

You can update the value data pair so it is empty and this will remove that custom field from the contact.

"custom_fields": [{
            "name": "CustomField15",
            "label": "CustomField15",
            "value": ""
}]

Our editor does not support the IfPropertyExists so that will not work; however this is not really needed if you update the value with a blank field it removes that custom field from the contact.


Regards,
Jimmy D.
Tier II API Support Engineer