Fields.Add

Overview

Adds a new field to an existing data extension

Syntax

Fields.Add(1)

Function Properties

Ordinal Type Description
1 object Required Object containing the properties of the new field

Example

This sample code demonstrates how to add a new field to an existing data extension:

var de = DataExtension.Init('SSJSTest');

var newField = {
  Name : "NewFieldV2",
  CustomerKey : "CustomerKey",
  FieldType : "Number",
  IsRequired: true,
  DefaultValue: "100"
};
var status = de.Fields.Add(newField);
Last Updated: Jun 8, 2021