Syntax

Attribute.GetValue(name)
1 argument

Description

The global Attribute object provides access to subscriber attribute (profile attribute) values when SSJS runs in an email or triggered send context. It is not available in CloudPages.

For CloudPages, read subscriber data from a Data Extension via Platform.Function.Lookup() / Platform.Function.LookupRows(), or use Platform.Recipient.GetAttributeValue in recipient-aware contexts.

The AMPscript parallel is AttributeValue() (different language); SSJS uses Attribute.GetValue(name).

Example

var firstName = Attribute.GetValue("FirstName");
var city      = Attribute.GetValue("City");

if (firstName) {
    Write("<p>Hello, " + firstName + "!</p>");
}

See Also