You may have seen this error message before when trying to delete a data extension field that already has a linked Attribute Group in Contact Builder:
You cannot delete any data extensions with existing data relationships before removing those relationships. Use Data Designer to remove those relationships before attempting a deletion.
SFMC Error Message when trying to delete a data extension field linked in Data Designer
If the data extension is unlinked in Data Designer, it runs the risk of severing the connection for existing journeys in Journey Builder that are currently using that Contact Data. In other words, if a journey is using that Contact Data as a Decision Split, that split may error because the Contact Data gets unlinked.
A better way would be to use the API on the backend to delete the data extension field/column.
First, follow the instructions to Create an Installed Package and Using Postman to Test API Access Token Request. You will need admin access and API access in SFMC.
The first step you will need to do is to retrieve the ObjectId of the Data Extension Field that you are trying to delete. The API will retrieve from the DataExtensionField object.
The API calls all use unique values such as the CustomerKey/External Key of a data extension, the object Id of a data extension field, etc. The data extension External Key is the unique identifier for the data extension. It is found when you click into the data extension on the left hand side above the Created Date, Last Modified Date, and Owner.
Use PostMan to retrieve your access_token and then use SoapUI to create a new project. Copy and paste the WSDL link created from the SFMC Installed Package.
Follow the instructions here on How To Get Bearer Auth V2 Token for API to get the access_token
Retrieve DataExtension Field Object Id
Using the Retrieve request, run the SOAP envelope below filling out the details to your access_token and external key of your data extension.
Note that if you are retrieving from a child BU, you will need to specify the MID:
<RetrieveRequest>
<ClientIDs>
<ClientID>[MID goes here]</ClientID>
</ClientIDs>
...
</RetrieveRequest>
You should get a response like the one below. Note that the <OverallStatus> should say “OK” and there should be a list of Data Extension field names and their corresponding ObjectId. If you have found the name and ObjectId of the field you would like to delete, make note of that ObjectId . Double check that it is the correct field.
Using Complex Filters and Data Extension Field Name
If you have a data extension with a lot of fields, the Soap UI response may not show all of the fields available. You may need to alter the DataExtensionField request to use a combination of complex and simple filters. See the example below using the name of the data extension field to filter:
Take note of the ObjectId of the field(s) to delete. This will be used in the Delete request on SoapUI.
Delete Data Extension Field using External Key and Object Id
Using the Delete request in SoapUI (not Execute), use the Soap Envelope below to delete your data extension field:
If done correctly, you should receive a <StatusCode> of ‘OK‘ and a <StatusMessage> of ‘Data Extension Fields deleted‘
It takes about 10 minutes for the deletion to appear in the user interface so just wait until it reflects on the front end. Make sure that you have Write access to data extensions when you installed the package otherwise it will not delete the Data Extension Field.
Good luck and let me know how it works for you when trying to delete a DataExtensionField via API.
I wonder does it work the same if we insert a new field? Thanks for an insightful article!
You can create a new field right from Contact Builder in the user interface.