Summary
AttributeValue()
Base64Decode()
Base64Encode()
Domain()
Empty()
FormatCurrency()
FormatNumber()
GUID()
Iif()
IsEmailAddress()
IsNull()
IsPhoneNumber()
Output()
OutputLine()
RaiseError()
Random()
v()
Returns the value of an attribute. The function determines this value using data sources related to the Contact or Subscriber that the message is sent to. These sources include email subscriber profiles, data extension fields, journey entry source attributes, and MobilePush attributes.
This function is a better option than making a direct reference to the attribute because it returns null if no data is found.
| Marketing Cloud Engagement | ✅ Yes |
| Marketing Cloud Next | ❌ No |
1AttributeValue(attribute)The AttributeValue() function has one parameter:
attribute (string): Required. The name of the attribute to return the value of.This example returns the value of the RewardTierPoints attribute from the sendable data extension associated with the message.
1%%[
2 Var @rewardTierPoints, @rewardTierText
3 Set @rewardTierPoints = AttributeValue("RewardTierPoints")
4
5 /* If there's no value for RewardTierPoints in the sendable data extension,
6 the AttributeValue() function returns null rather than causing the email
7 send to fail. You can then handle the situation where the value is null. */
8 If empty(@rewardTierPoints) Then
9 Set @rewardTierText = "You haven’t registered yet. <a href='https://example.com/signup'>Sign up today</a>!"
10 Else
11 Set @rewardTierText = Concat("You have ", @rewardTierPoints, " points.")
12 EndIf
13]%%
14
15<p>%%= v(@rewardTierText) =%%</p>