Data Extension fields verified

Quick reference about Data Extension fields in Salesforce Marketing Cloud (SFMC) with SSJS (server-side JavaScript).

Allowed attributes per field type

[
    {
        "Name": "MyTextField",
        "FieldType": "Text",
        "MaxLength": 50,
        "DefaultValue": "Example text"
    },
    {
        "Name": "MyNumberField",
        "FieldType": "Number",
        "DefaultValue": "25"
    },
    {
        "Name": "MyDateField",
        "FieldType": "Date",
        "DefaultValue": "2022-09-30T13:30:00"
    },
    {
        "Name": "MyBooleanField",
        "FieldType": "Boolean",
        "DefaultValue": "False"
    },
    {
        "Name": "MyEmailField",
        "FieldType": "EmailAddress"
    },
    {
        "Name": "MyPhoneField",
        "FieldType": "Phone"
    },
    {
        "Name": "MyDecimalField",
        "FieldType": "Decimal",
        "Scale": 2,
        "MaxLength": 18
    },
    {
        "Name": "MyLocaleField",
        "FieldType": "Locale"
    }
    
]

Commonly allowed attributes

{
    "IsPrimaryKey": true,
    "IsRequired" : true,
    "Ordinal": 0
}

WARNING

The fields of type EmailAddress, Phone and Locale are not allowed to have a DefaultValue attribute. Decimal type field should be allowed, but returns an error.

Help me turn coffee into code

This website is provided to you free of charge. However, a lot of time and effort are spent to write, test and mainain the code. Please consider supporting my work by buying me a cup of coffee.

Last Updated: