2

When using the C# library and SOAP to retrieve an automation, the AutomationTasks property will always be null even though the SOAP envelop of the response actually contains the AutomationTasks Node.

Here is the code used to make the SOAP call:

RetrieveRequest rr = new RetrieveRequest(); rr.ObjectType = "Automation";

rr.Filter = new SimpleFilterPart()
{
    Property = "Name",
    SimpleOperator = SimpleOperators.equals,
    Value = new string[] { "automation name" } };

rr.Properties = new string[] { "*" };

status = soapclient.Retrieve(rr, out requestID, out results);

The SOAP envelop of the response will contain something like this:

<AutomationTasks>
    <AutomationTask>
        <PartnerKey xsi:nil="true"/>
        <ObjectID xsi:nil="true"/>
        <Activities>
            <Activity>
                <PartnerKey xsi:nil="true"/>
                <CreatedDate>2016-02-15T09:25:10.48</CreatedDate>
                <ObjectID>2842d36d-0aa5-4e75-bf14-3f20e7afde3c</ObjectID>
                <CustomerKey>08ffc405-5457-4598-bcb2-877ee3af9c5d</CustomerKey>
                <Name>The name of my query</Name>
                <Description/>
                <IsActive>true</IsActive>
                <Definition>
                    <PartnerKey xsi:nil="true"/>
                    <ObjectID xsi:nil="true"/>
                    <CustomerKey>08ffc405-5457-4598-bcb2-877ee3af9c5d</CustomerKey>
                </Definition>
                <Sequence>0</Sequence>
            </Activity>
        </Activities>
    </AutomationTask>
</AutomationTasks>

There seems to be a problem with the deserialization process.

Moreover, from the data contained in the response, I do not know how could one deduce the type of the activity (query, email, etc.).

Also, I could only obtain the AutomationTasks node when using an "*" in the RetrieveRequest.Properties field. I could not make it work by explicitly requesting the AutomationTasks field.

EDIT:

After a few tests, I discovered that only the Tasks of the automations I created using the API were in the SOAP envelop. In other words, if an automation was created using the marketing cloud application, the AutomationTasks node was empty.

Your Answer

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

Browse other questions tagged or ask your own question.