Perform using Batches untested

Learn how to perform using batches (performBatch) in Salesforce Marketing Cloud (SFMC) with SSJS (server-side JavaScript). Code snippets include WSProxy methods.

Perform a DataExtract Activities

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

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

var action = "start";

var options = {};

var result = api.performBatch("DataExtensionObject", batches, action, options);
<script runat="server">

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

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

	try {

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

        var action = "start";

        var options = {};

        var result = api.performBatch("DataExtensionObject", batches, action, options);

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

</script>
coming soon...

Last Updated: