0

Does anyone know how to define the location for the data extension when using SOAP api to create a data extension?

3

You can use it by <CategoryID> tag in SOAP to add it in folder. If you use Inspect (Open in Chrome > Right click > Inspect > click on the data extension folder) on the category Id will be the parent folder ID.

enter image description here

Below can be same example for SOAP UI to create a data extension in a folder:

<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:par="http://exacttarget.com/wsdl/partnerAPI">
    <soapenv:Body>
        <par:CreateRequest>
            <par:Options/>
            <par:Objects
                    xsi:type="par:DataExtension">
                <par:Client>
                    <par:ClientID>MID</par:ClientID>
                </par:Client>
                <par:CategoryID>Folder ID</par:CategoryID>
                <par:ModifiedDate xsi:nil="true"/>
                <par:ObjectID xsi:nil="true"/>
                <par:Name>Data Extension Name</par:Name>
                <par:Description>Data Extension Description</par:Description>
                <par:IsSendable>false</par:IsSendable>
            <par:IsTestable>false</par:IsTestable>
            <par:DataRetentionPeriodLength>48</par:DataRetentionPeriodLength>
            <par:DataRetentionPeriod>Days</par:DataRetentionPeriod>
            <par:RowBasedRetention>false</par:RowBasedRetention>
            <par:ResetRetentionPeriodOnImport>true</par:ResetRetentionPeriodOnImport>
            <par:DeleteAtEndOfRetentionPeriod>false</par:DeleteAtEndOfRetentionPeriod>
                <par:Fields>
                <par:Field>
                    <par:CustomerKey>PE_ID</par:CustomerKey>
                    <par:Name>PE_ID</par:Name>
                    <par:Description>PE_ID</par:Description>
                    <par:IsPrimaryKey>true</par:IsPrimaryKey>
                    <par:MaxLength>100</par:MaxLength>
                    <par:FieldType>Text</par:FieldType>
                    <par:DefaultValue></par:DefaultValue>
                    <par:IsRequired>true</par:IsRequired>
                </par:Field>
                </par:Fields>
            </par:Objects>
        </par:CreateRequest>
    </soapenv:Body>
</soapenv:Envelope>

Let me know if this helps.

| improve this answer | |
  • 1
    This is about creating a data extension folder, but the OP is asking about adding a Data Extension into a specific folder. Great info, but it is not what the question is about. Please adjust it to reflect what is being asked. – Gortonington May 14 at 12:45
  • 1
    Thanks @Gortonington for rightly pointing out. Am sorry, I overlooked the question. I have updated my answer now. – Naveen VM May 14 at 14:31
  • Thanks @NaveenVM, this worked. – Willem Ruys May 19 at 8:54
  • You are welcme @WillemRuys.! Am glad that it worked for you. – Naveen VM May 19 at 10:25
1

We use ssjs to create Data Extension and we use the property CategoryID on the data extension object. We set the value to a static value of the folder in which we wish to create the data extension. When you hover over your folder, you will see the id at the bottom. See below. I have not worked with SOAP API, but I believe the underlying object and property remains the same. Hope this helps :)

enter image description here

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.