Study FAQ
How do I use an alternate key and Upsert to synchronize Dataverse rows safely?
Also asked as 2
- 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?
Answer
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 · Upsert with SDK and Web API
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 · Standard-table Upsert processing
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
Full explanation
AB-400: Synchronizing Dataverse with Change Tracking and Upsert
Study guide · AB-400
Read the full explanation