# SetObjectProperty()

Sets a value for an object created by the `CreateObject()` function.

## Availability

<table>
  <tr>
    <td>Marketing Cloud Engagement</td>
    <td>✅ Yes</td>
  </tr>
  <tr>
    <td>Marketing Cloud Next</td>
    <td>❌ No</td>
  </tr>
</table>

## Syntax

```
SetObjectProperty(apiObject,
                  propertyName,
                  propertyValue)
```

The `SetObjectProperty()` function has three parameters:

- `apiObject` (API Object): Required. The API Object that you’re setting a value for.
- `propertyName` (string): Required. The name of the property to assign a value to.
- `propertyValue` (string): Required. The value to assign to the property.

## Usage

This example creates an API Object called Subscriber, gives it the EmailAddress property, and sets the value of that property to an email address.

```
Var @email, @subscriber

Set @email = "miyuki.noguchi@example.com"
Set @subscriber=CreateObject('Subscriber')
SetObjectProperty(@subscriber, 'EmailAddress', @email)
```

## See Also

- [CreateObject()](/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-api/mc-ampscript-reference-api-create-object.md)
- [API Create Method](/docs/marketing/marketing-cloud/guide/create.md)
