5

I'm having issues trying to update a Data Extension Field Name using the SOAP API.

I've followed the documentation to Update Column Properties for a Data Extension.

I've tried different permutations of this request envelope and tried both in a parent and child business unit. I get a Data Extension updated message back each time, but the field is not updated.

Here are the steps that I'm taking. Feel free to paste these envelope requests in Postman and try yourself.

First, I get the ObjectId values of fields in the DE:

POST {{soap_instance_url}}Service.asmx
Content-Type: text/xml

<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
   <s:Header>
      <a:Action s:mustUnderstand="1">Retrieve</a:Action>
      <a:MessageID>urn:uuid:7e0cca04-57bd-4481-864c-6ea8039d2ea0</a:MessageID>
      <a:ReplyTo>
         <a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address>
      </a:ReplyTo>
      <a:To s:mustUnderstand="1">{{soap_instance_url}}Service.asmx</a:To>
      <fueloauth xmlns="http://exacttarget.com">{{access_token}}</fueloauth>
   </s:Header>
   <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
 <RetrieveRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
         <RetrieveRequest>
            <Client>
                <ID>{{mid}}</ID>
            </Client>
            <ObjectType>DataExtensionField</ObjectType>
            <Properties>Name</Properties>
            <Properties>ObjectID</Properties>
            <Filter xsi:type="SimpleFilterPart">
               <Property>DataExtension.CustomerKey</Property>
               <SimpleOperator>equals</SimpleOperator>
               <Value>A7325CF7-B136-4C22-986C-18C00EE181EA</Value>
            </Filter>
            <QueryAllAccounts>true</QueryAllAccounts>
            <Retrieves />
            <Options>
               <SaveOptions />
               <IncludeObjects>true</IncludeObjects>
            </Options>
         </RetrieveRequest>
      </RetrieveRequestMsg>
   </s:Body>
</s:Envelope>

This returns the following response:

<RetrieveResponseMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
    <OverallStatus>OK</OverallStatus>
    <RequestID>a5164618-c518-421f-b762-ffd723a708f8</RequestID>
    <Results xsi:type="DataExtensionField">
        <PartnerKey xsi:nil="true" />
        <ObjectID>ce0a7bc6-2ec4-4a8a-bf49-086fc4cdd533</ObjectID>
        <Name>Field 1</Name>
    </Results>
    <Results xsi:type="DataExtensionField">
        <PartnerKey xsi:nil="true" />
        <ObjectID>7b6bb682-ddaf-4377-8837-1017e4d9c496</ObjectID>
        <Name>Field 2</Name>
    </Results>
</RetrieveResponseMsg>

I want to update the field name for 'Field 2', so I then make this request:

POST {{soap_instance_url}}Service.asmx
Content-Type: text/xml

<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
   <s:Header>
      <a:Action s:mustUnderstand="1">UpdateAdd</a:Action>
      <a:MessageID>urn:uuid:7e0cca04-57bd-4481-864c-6ea8039d2ea0</a:MessageID>
      <a:ReplyTo>
         <a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address>
      </a:ReplyTo>
      <a:To s:mustUnderstand="1">{{soap_instance_url}}Service.asmx</a:To>
      <fueloauth xmlns="http://exacttarget.com">{{access_token}}</fueloauth>
   </s:Header>
   <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <UpdateRequest xmlns="http://exacttarget.com/wsdl/partnerAPI">
           <Client>
                <ID>{{mid}}</ID>
            </Client>
         <Options/>
         <Objects xsi:type="DataExtension">
            <CustomerKey>A7325CF7-B136-4C22-986C-18C00EE181EA</CustomerKey>
            <fields>
               <field>
                  <PartnerKey xsi:nil="true"></PartnerKey>
                  <ObjectID>7b6bb682-ddaf-4377-8837-1017e4d9c496</ObjectID>
                  <Name>New Field Name</Name>
               </field>
            </fields>
         </Objects>
      </UpdateRequest>
   </s:Body>
</s:Envelope>

I always get the following response back, but the field name is never updated:

<UpdateResponse xmlns="http://exacttarget.com/wsdl/partnerAPI">
    <Results>
        <StatusCode>OK</StatusCode>
        <StatusMessage>Data Extension updated.</StatusMessage>
        <OrdinalID>0</OrdinalID>
        <Object xsi:type="DataExtension">
            <PartnerKey xsi:nil="true" />
            <ObjectID>98ccd6c4-a1e5-e911-80f3-1402ec721f79</ObjectID>
            <CustomerKey>BCAA7DAC-34D1-488F-9C06-A63E04DF2E77</CustomerKey>
        </Object>
    </Results>
    <RequestID>072195ee-09fa-4dcb-91b3-bdd066efe37a</RequestID>
    <OverallStatus>OK</OverallStatus>
</UpdateResponse>

I feel like I've exhausted every option! I'd love to hear from anyone who has been able to get this to work.

1 Answer 1

4

Indeed, I've tried using your code without sucess.

It seems that the problem is coming from the Fields and Field attributes. You forgot the F in uppercase..

<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
   <s:Header>
      <a:Action s:mustUnderstand="1">UpdateAdd</a:Action>
      <a:MessageID>urn:uuid:7e0cca04-57bd-4481-864c-6ea8039d2ea0</a:MessageID>
      <a:ReplyTo>
         <a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address>
      </a:ReplyTo>
      <a:To s:mustUnderstand="1">{{url}}/Service.asmx</a:To>
      <fueloauth xmlns="http://exacttarget.com">{{token}}</fueloauth>
   </s:Header>
   <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <UpdateRequest xmlns="http://exacttarget.com/wsdl/partnerAPI">
         <Objects xsi:type="ns1:DataExtension" xmlns:ns1="http://exacttarget.com/wsdl/partnerAPI">
                <CustomerKey>TEST_GENERIQUE</CustomerKey> 
                <Fields>
                    <Field>
                        <ObjectID>7e97367f-4af2-4126-a703-c319780dc120</ObjectID>
                        <Name>yourField</Name> 
                    </Field>
                </Fields>
            </Objects>
      </UpdateRequest>
   </s:Body>
</s:Envelope>
4
  • I don't believe that I forgot the uppercase F, I just copied the example provided. I think it requires an uppercase F due to the xmlns:ns1 namespace you are using. Either way, I can't get this envelope to work either. I'm getting a different error with your request. Are you sure it's working for you? Commented Oct 3, 2019 at 11:18
  • Did you change the DE CustomerKey on the code I've provided? And to answer your question, yeah, I've just tested on a new DE and it is working perfectly. Commented Oct 3, 2019 at 11:48
  • Just tested this on another account and it works. Thanks! Commented Oct 3, 2019 at 12:31
  • 2
    ha, thanks guys - I used your approach to enable field renaming in mc devtools ;-) #credit Commented Aug 12, 2021 at 9:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .