2

I am currently trying to programmatically sort out Automation Studio activities (e.g. Email, SQL Query, Filter, and Script activities) into designated folders. I have started with Filters, based on the related SOAP object, there are some fields that are retrievable yet there is no "CategoryID" field available as SQL Query activity has. So here is what I did to reassure:

<script language="javascript" runat="server">
    Platform.Load("Core", "1");
    var prox = new Script.Util.WSProxy();

    var cols = [
        /*"FilterActivityID"*/
        /*,"FilterDefinitionID"*/
        "DestinationObjectID"
        ,"DestinationTypeID"
        ,"SourceObjectID"
        ,"SourceTypeID"
        /*,"OwnerID"*/
        ,"StatusID"
        /*,"CreatedBy"*/
        /*,"ModifiedBy"*/
        /*,"InteractionObjectID"*/
        ,"Name"
        ,"Description"
        /*,"Keyword"*/
        /*,"Client"*/
        /*,"PartnerKey"*/
        /*,"PartnerProperties"*/
        ,"CreatedDate"
        ,"ModifiedDate"
        ,"ObjectID"
        ,"CustomerKey"
        /*,"Owner"*/
        /*,"CorrelationID"*/
        /*,"ObjectState"*/
        /*,"IsPlatformObject"*/
    ];
    var filter = {Property: "CustomerKey", SimpleOperator: "equals", Value: "xxxx"};
    var data = prox.retrieve("FilterActivity", cols, filter);
    Write(Stringify(data));
</script>

Commented out columns turned out to be non-retrievable even though some of them actually should be retrievable based on the documentation. On another side, it is also possible to retrieve on the Folder to which I want to move the activities and see its "ContentType":"filteractivity" and "FolderID" values to use them later on for moving the activity but it seems we are limited on parameters that could be updated for the activity.

Hence, my question - am I missing something, and generally is there a possible way of moving Automation Studio activities into folders programmatically?

1 Answer 1

1

FilterActivity objects don't have an exposed CategoryID property, so you can't move them. It does seem like they do in older accounts -- since the Filter Activities are still listed under Interactions in Email Studio.

One little trick for finding retrievable SOAP properties -- find your BU's tenant ID, and browse to the WSDL URL and hit CTRL-E to view the source of the page. Search for the object and review the IsRetrievable properties.

3
  • Thanks for your answer and little trick! Do you know if there is a possibility to move Email, SQL Query, or Script activities programmatically? It would save so much time sorting things this way.
    – Niko
    Dec 30, 2021 at 10:20
  • Yes, sure if an object has a CategoryID property. Dec 30, 2021 at 13:56
  • So, based on that, we can say that CategoryID property is the only thing that allows us to move objects and if it does not exist then the object is immovable, right? I was hoping there are other ways how we can move assets.
    – Niko
    Dec 30, 2021 at 17:49

You must log in to answer this question.

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