AddObjectArrayItem()

Adds an object to an array in a Marketing Cloud Engagement API object.

Availability 

Marketing Cloud Engagement ✅ Yes
Marketing Cloud Next ❌ No

Syntax 

1AddObjectArrayItem(apiObject,
2                   arrayProperty,
3                   itemToAdd)

The AddObjectArrayItem() function has three parameters:

  • apiObject (API Object): Required. The API object that contains the array that you want to modify.
  • arrayProperty (string): Required. The array property to receive the new item.
  • itemToAdd (string): Required. The item to add to the array.

Usage 

This example adds the attribute myNewAttribute to the Attributes array on the mySubscriber API object.

1%%[
2  AddObjectArrayItem(@mySubscriber,'Attribute',@myNewAttribute)
3]%%