# How do I use an alternate key and Upsert to synchronize Dataverse rows safely?

Exam: AB-400 — Power Platform Developer Associate
Knowledge domain: Develop integrations (10–15%)
Updated: 2026-11-25T06:47:20.815637+00:00
HTML: https://learningpathx.com/faq/AB-400/ab400-dataverse-alternate-key-upsert-projection.html

## Also asked as

- How should a Dataverse integration identify and update projection rows with Upsert?
- How can I reapply a Dataverse sync write with the same alternate key and preserve locally owned fields?

On a standard Dataverse destination table, use an active alternate key derived from the source's stable identity and send only the field values that the source owns. In the .NET SDK, put the identifying values in `Entity.KeyAttributes`, put the write payload in `Entity.Attributes`, and send an `UpsertRequest` through `IOrganizationService.Execute`. In the Web API, put the key in the `PATCH` resource URL and the owned values in the body. [Define Dataverse alternate keys](https://learn.microsoft.com/en-us/power-apps/developer/data-platform/define-alternate-keys-entity) · [Upsert with SDK and Web API](https://learn.microsoft.com/en-us/power-apps/developer/data-platform/use-upsert-insert-update-record)

A source-environment tag plus source row GUID can identify a projection across renames. Check that the unique index is Active and that the chosen values work with the Web API's alternate-key character restrictions if using HTTP. Treat changes in identity derivation as a migration. For a standard table, the SDK's `RecordCreated` tells you which outcome occurred, and `Target` identifies the row. If a response is lost, recover or reapply using the same key. Exclude locally owned fields and define how a source null is mapped. [Alternate key index and constraints](https://learn.microsoft.com/en-us/power-apps/developer/data-platform/define-alternate-keys-entity) · [Standard-table Upsert processing](https://learn.microsoft.com/en-us/power-apps/developer/data-platform/use-upsert-insert-update-record)

An elastic-table Upsert can replace the existing row data and does not raise the standard Create or Update messages. Review its mapping and logic separately. On any destination, repeated requests may still produce duplicate automation effects, even when row identity prevents duplicate records. Test create, rename and replay under the same logical key, then confirm local fields and related effects. [Elastic-table Upsert behavior](https://learn.microsoft.com/en-us/power-apps/developer/data-platform/use-upsert-insert-update-record)

Source: [AB-400: Synchronizing Dataverse with Change Tracking and Upsert](https://learningpathx.com/news/ab-400-synchronizing-dataverse-with-change-tracking-and-upsert.html)
