Perform a DataExtract Activity untested

Learn how to perform a DataExtract Activity in Salesforce Marketing Cloud (SFMC) with SSJS (server-side JavaScript). Code snippets include the WSProxy method.

WSProxy

var api = new Script.Util.WSProxy();

var action = "start";

var properties = {
    ObjectID: "S0M3-GU1D-K3Y-G03SR1G4T-H3R3",
    PartnerProperties: [
        {
            "Name": "OutputFileName",
            "Value": "MyTitle.txt"
        }
    ]
};

var options = {};

var result = api.performItem("DataExtractActivity", properties, action, options);
<script runat="server">

    Platform.Load("Core","1");

    var api = new Script.Util.WSProxy();

    try {

        var action = "start";

        var properties = {
            ObjectID: "S0M3-GU1D-K3Y-G03SR1G4T-H3R3",
            PartnerProperties: [
                {
                    "Name": "OutputFileName",
                    "Value": "MyTitle.txt"
                }
            ]
        };

        var options = {};

        var result = api.performItem("DataExtractActivity", properties, action, options);

        Write(Stringify(result));

    } catch(error) {
        Write(Stringify(err));
    }

</script>
coming soon...

Last Updated: