---
schema_version: "1"
id: 47c8241ea1c78982e4fac8a1a5679cd0e0b083e10eefc96bac0e548bb57e1c9d
title: AttributeValue()
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud/ampscript/references/utilities/mc-ampscript-reference-utilities-attribute-value.md
canonical_url: https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-utilities/mc-ampscript-reference-utilities-attribute-value.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 7670ce28e03650b75e2ad3ecdb72b9311c5f0a1d62909c8750162bb4c56da361
products:
  - AMPscript for Marketing Cloud
  - Marketing Cloud
---
# AttributeValue()

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.

## Availability

<table>
  <tr>
    <td>Marketing Cloud Engagement</td>
    <td>✅ Yes</td>
  </tr>
  <tr>
    <td>Marketing Cloud Next</td>
    <td>❌ No</td>
  </tr>
</table>

## Syntax

```
AttributeValue(attribute)
```

The `AttributeValue()` function has one parameter:

- `attribute` (string): Required. The name of the attribute to return the value of.

## Usage

This example returns the value of the `RewardTierPoints` attribute from the sendable data extension associated with the message.

```
%%[
  Var @rewardTierPoints, @rewardTierText
  Set @rewardTierPoints = AttributeValue("RewardTierPoints")

  /* If there's no value for RewardTierPoints in the sendable data extension,
     the AttributeValue() function returns null rather than causing the email
     send to fail. You can then handle the situation where the value is null. */
  If empty(@rewardTierPoints) Then
    Set @rewardTierText = "You haven’t registered yet. <a href='https://example.com/signup'>Sign up today</a>!"
  Else
    Set @rewardTierText = Concat("You have ", @rewardTierPoints, " points.")
  EndIf
]%%

<p>%%= v(@rewardTierText) =%%</p>
```
