Skip to main content
Level 1
May 20, 2026
Question

How to clear an array field on an upsert-enabled dataset with array_replace mapping?

  • May 20, 2026
  • 2 replies
  • 17 views

We have a non-XDM compatible dataset enabled for upsert with a couple of fields of type Object[].

rootNode.fieldName: Object[]
rootNode.anotherFieldName: Object[]

We want to be able to edit one of them at a time and to replace the whole list on that update operation, including emptying out the list. On the dataflow mappings we have that field mapped as

upsert_array_replace(rootNode.fieldName) -> rootNode.fieldName

We were able to see full list replacements where the profile attribute had [A, B] and we sent [C] and it worked correctly becoming just [C].

Our issue is that we couldn't clean the field from [A. B] to [] by sending [] or null, or anything else we could think of on the HTTP merge-enabled call.

How can we clean an attribute of type list in that case?

2 replies

Level 3
May 20, 2026

Hi ​@MatheusCa3,

 

This is a known limitation with upsert_array_replace when trying to clear an array field to empty in AEP profile store.

 

The issue is that sending an empty array [] or null via the HTTP merge-enabled call does not trigger the array_replace behavior the same way a populated array does. AEP's upsert merge logic treats an empty array or null as a no-op in many cases rather than an intentional replacement, so the existing values are preserved instead of being cleared.

 

There are a few approaches to work around this.

 

The first option is to send a sentinel value as a placeholder. Instead of sending an empty array, send an array containing a known empty or null-equivalent object that your downstream logic can interpret as "no data." This is not ideal semantically but it does trigger the array_replace merge correctly. Your application layer then filters out the sentinel when reading the data.

 

The second option is to use the Profile Delete API to remove the specific attribute rather than trying to overwrite it to empty. If the intent is to fully clear the field, a targeted attribute delete via the Profile API is more reliable than trying to upsert an empty value. The endpoint is PATCH on the profile entity with the specific field path and a remove operation.

 

The third option is to check whether your dataset's merge policy supports attribute-level deletion. If you are using a custom merge policy with dataset precedence, you may be able to configure a dataset that explicitly sends empty values with higher precedence to force the clear.

 

Of the three, the Profile API patch with a remove operation is the cleanest approach if emptying the array is a regular use case. The sentinel value approach works but adds complexity to your data model. Can you share whether you have access to use the Profile API directly or if you are limited to the dataflow ingestion path? That will help narrow down the best approach for your setup.
 

Devyendar
Level 6
May 21, 2026

@MatheusCa3 For Object[], upsert_array_replace() is the correct mapping for replacing the full array, and Adobe documents that streaming upserts must use upsert_array_replace or upsert_array_append for array fields. However, 

If [A, B] -> [C] works but [A, B] -> [] does not, then this looks like a limitation/edge case in streaming upsert behavior rather than a mapping issue.

Raise an Adobe Support to get an enhancement or workaround suggestion.

In practical approach you can also consider pass [{}] instead of just [] or some other placeholder values to replace the object.