Loading

Journey Builder 'Update Contact Activity' with Data Extension using composite primary keys

Fecha de publicación: Jan 23, 2025
Descripción

Update Contact Activity (DE Update) identifies rows to update by using the field in the target Data Extension that relates to Subscribers. It is expected that this field is populated with values matching to ContactKey (the field relates to Subscribers using SubscriberKey).

Data Extensions are not problematic when defining a Primary Key as the field related to Subscribers. The Update Contact Activity will isolate and update the appropriate row.

For Data Extensions that do not utilize a Primary Key, this is also not an issue. Updated data will be written to any rows containing a value matching to the Contact Key value for the Contact evaluated by the Update Contact activity.

However, if the targeted Data Extension utilizes a composite key (for example, ContactKey + PurchaseID), it will not be possible to ensure that an update only applies to a specific row in some situations. For example, if there are multiple rows where ContactKey matches, the update will affect all rows. There is no current method for comparing to both ContactKey and other fields also used as Primary Keys in a Composite Key.

Solución

Possible workarounds


Workaround #1 - Perform the update using content-based script

The various Journey Builder Activities that operate sends, e.g.: Send Email or Send SMS, all have the capability of operating scripted actions as part of sending. The content built for use with the activity would contain AMPScript or Server-side Javascript capable of updating a Data Extension (learn more in Introduction to Programmatic Marketing Content). Both scripting languages can accommodate updates that respect composite primary keys. No Update Contact Activity would be used in this configuration.

Consideration: Requires message delivery of some kind


Workaround #2 - Use a Custom Journey Builder Activity

A custom activity can be built to use the Marketing Cloud APIs to perform advanced, customized actions relating to each Contact evaluated by the activity. Here, those actions would include an update to the appropriate row, matching to the composite key, via an API service like Data Events

Consideration: Building a custom activity requires time and resource commitments, typically ongoing, to build and maintain the application used by the activity and the environment it operates within.


Workaround #3 - Consolidate values from the composite key into a single Primary Key

In theory, a single field can hold a value that is the result of concatenating two or more values that normally comprise a composite key. Uniqueness will be maintained with the new, single field Primary Key. This value could be utilized across the Marketing Cloud application as the ContactKey. The single Primary Key is used to relate to subscribers in the Update Contact's target Data Extension. Since no composite key is in use, the issue of unintended updates to multiple rows is not of concern.

Consideration: Implementing this type of configuration may only truly be feasible in situations where a production deployment of Contacts and/or Journey Builder has not yet occurred. 
Please note that Primary Key is not used as a look-up for Update Contact activity. 

Número del artículo de conocimiento

000382018

 
Cargando
Salesforce Help | Article