2

I recently stumbled across the WSProxy which seems to be interesting particularly as they seem to be more convenient to use than traditional soap calls and reduce performance overhead.

WsProxy Documentation

I am trying it out, but can seem to get it to work.

I am running the sample code as a script activity in Automation Studio and here is my code:

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

var guid = Platform.Function.GUID();
var name = "my test de - " + guid;

var de = {
    Name: name,
    CustomerKey: guid,
    Description: "Another DE added via SSJS",
    Fields: [{
        FieldType: "Text",
        Name: "ID",
        MaxLength: 36,
        IsPrimaryKey: true,
        IsNillable: false,
        IsRequired: true
    },
    {
        FieldType: "Text",
        Name: "Name",
        MaxLength: 200
    }],
    CategoryID: 101377
}

var res = prox.createItem("DataExtension", de);
</script> 

The script runs, but the DE is not created. I would appreciate any pointers on this.

2
  • The code is works for me within really small change - CategoryId, so check your CategoryId Commented Jun 19, 2018 at 19:28
  • When is change it the activity fails :(
    – 0xsegfault
    Commented Jun 19, 2018 at 19:47

1 Answer 1

6

The CategoryID you are using is taken from Official Documentation so you need to replace it with yours.

Just hover with mouse on your Data Extension folder and check status bar: enter image description here
you will find categoryId there.

You must log in to answer this question.

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