Syntax

Platform.Load(libraryName, version);

Parameters

Name Type Required Description
libraryName string Yes Library to load. Currently: "core"
version string Yes Version string. Use "1.1.5" for current Core

Examples

// Must be the first statement in your script
Platform.Load("core", "1.1.5");

// Now you can use Core library objects
var de = DataExtension.Init("MyDE");
var rows = de.Rows.Retrieve();

Available Libraries

Library Version Namespace Objects
"core" "1.1.5" DataExtension, Subscriber, List, Email, TriggeredSend, HTTP, Script.Util

Notes

Call Order is Critical

Platform.Load must be the first statement in your <script runat="server"> block. If you call any Core library functions before Platform.Load, you will get a runtime error.

// WRONG — will throw "Object doesn't support this property or method"
var de = DataExtension.Init("MyDE");
Platform.Load("core", "1.1.5");

// CORRECT
Platform.Load("core", "1.1.5");
var de = DataExtension.Init("MyDE");

Multiple Script Blocks

Each <script runat="server"> block shares variable scope, but Platform.Load only needs to be called once. However, the block where Core is first used must have it loaded. Best practice is to have Platform.Load in the very first script block on the page.

Version Numbers

The version "1.1.5" is the correct production version. Do not use "1" or "1.1" — while these may work, they may resolve to older builds with subtle differences.

What Loading Core Enables

Loading Core gives you access to the following objects:

See Also