Contact Us

April 22, 2025

June 23, 2026 10:36 pm

Updating a single record in a data extension using Journey Builder

Share with

Understanding the Issue

In Salesforce Marketing Cloud, when you use the Update Contact activity in Journey Builder to update a record in a data extension, it uses the subscriber key to identify the record to update. If there are multiple records with the same subscriber key, all of them will be updated.

Solution

To update a single record in a data extension using Journey Builder, you need to have a unique identifier for that record. This can be achieved by using a composite primary key or a unique field.

The root cause of this issue is that the subscriber key is not unique for each record in the data extension, causing all records with the same subscriber key to be updated.

To fix this issue, you can add a unique field to the data extension and use it as a primary key. Alternatively, you can use a composite primary key, which is a combination of two or more fields that uniquely identify each record.

Update Contact Activity

/* Update Contact Activity */
UPDATE MyDataExtension
SET Field1 = 'Value1',
    Field2 = 'Value2'
WHERE SubscriberKey = 'unique-subscriber-key' AND UniqueField = 'unique-value'

Heads up: When using a composite primary key, make sure to include all the fields in the key in the WHERE clause of the Update Contact activity.

Best Practices

Checklist for Updating a Single Record in a Data Extension

  • Use a unique identifier for each record in the data extension.
  • Use a composite primary key or a unique field as the primary key.
  • Include all fields in the primary key in the WHERE clause of the Update Contact activity.
  • Test the Update Contact activity to ensure it is updating the correct record.
  • Use the Update Contact activity to update records in a data extension, rather than using SQL queries.

Frequently Asked Questions

What is the subscriber key in Journey Builder?

The subscriber key is a unique identifier for each subscriber in a data extension.

Can I use a composite primary key in Journey Builder?

Yes, you can use a composite primary key in Journey Builder to uniquely identify each record in a data extension.

How do I update a single record in a data extension using Journey Builder?

To update a single record in a data extension using Journey Builder, you need to have a unique identifier for that record, which can be achieved by using a composite primary key or a unique field.

What is the best practice for updating records in a data extension using Journey Builder?

The best practice is to use the Update Contact activity to update records in a data extension, rather than using SQL queries.

Genetrix Technology · Salesforce Marketing Cloud Partner

Need help shipping this in production?

Genetrix builds and untangles Salesforce Marketing Cloud and Agentforce setups for teams that want it done right the first time. If anything in this post sounds familiar, talk to us before it ships.

Get in Touch with Genetrix →

Blogs for the

Business-Savvy!​

Let’s Connect

A 30 min no cost strategy session
with cloud support expert

Let’s Connect

A 30 min no cost strategy session
with cloud support expert