SSJS

Create a Campaign Members Flat DE

<script runat="server">

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

var deObj = { "CustomerKey" : "CampaignMembers_SF", "Name" : "CampaignMembers_SF",

"Fields" : [

{

"Name": "CampaignMemberID",

"FieldType": "Text",

"IsPrimaryKey": true,

"IsRequired": true,

"MaxLength": 18

},

{

"Name": "CampaignID",

"FieldType": "Text",

"IsRequired": true,

"MaxLength": 18

},

{

"Name": "CampaignName",

"FieldType": "Text",

"IsRequired": true,

"MaxLength": 255

},

{

"Name": "ParentCampaignID",

"FieldType": "Text",

"MaxLength": 18

},

{

"Name": "ParentCampaignName",

"FieldType": "Text",

"MaxLength": 255

},

{

"Name": "LeadID",

"FieldType": "Text",

"IsRequired": true,

"MaxLength": 18

},

{

"Name": "ContactID",

"FieldType": "Text",

"IsRequired": true,

"MaxLength": 18

},

{

"Name": "AccountID",

"FieldType": "Text",

"IsRequired": true,

"MaxLength": 18

},

{

"Name" : "Email",

"FieldType" : "EmailAddress"

},

{

"Name" : "Age",

"FieldType" : "Number"

},

{

"Name": "FirstName",

"FieldType": "Text",

"IsRequired": false,

"MaxLength": 100

},

{

"Name": "LastName",

"FieldType": "Text",

"IsRequired": false,

"MaxLength": 100

},

{

"Name": "Gender",

"FieldType": "Text",

"IsRequired": false,

"MaxLength": 70

},

{

"Name" : "BMDA_Patient",

"FieldType" : "Boolean",

"DefaultValue": null

},

{

"Name" : "Status",

"FieldType": "Text",

"IsRequired": false,

"MaxLength": 70

},

{

"Name" : "DateAddedToCampaign",

"FieldType": "Date",

"Ordinal": 2

}

]};

var myDE = DataExtension.Add(deObj);

</script>