Summary

Completed

You now have the tools to keep Microsoft Dataverse synchronized with an external system in both directions. You retrieve only what changed and handle inbound records whether or not they already exist.

Contoso's equipment-provisioning scenario ties the three mechanisms together. Change tracking moves data out to the procurement and reporting systems efficiently. Alternate keys let the vendor's inventory feed reference a Device record by its own vendor code. Upsert lets that same feed create or update a record in a single call.

What you learned

  • Change tracking lets a downstream system retrieve only the rows that changed since its last check, instead of re-reading an entire table. You request this through the Web API's Prefer: odata.track-changes header or the SDK's RetrieveEntityChangesRequest. You store the delta link or data token for the next call. You also watch for the expiration window set by ExpireChangeTrackingInDays, since enabling change tracking on a table is permanent.
  • Alternate keys give a table a business-meaningful identifier, either a single column or a composite of several. Code can then find a record using a value like a vendor device code, instead of first translating it into a GUID. You define the key through CreateEntityKey, then reference the record directly in a URL or through KeyAttributes on an Entity or EntityReference.
  • The UpsertRequest message combines create and update logic into one call, so an inbound feed doesn't need to know in advance whether a record exists. Dataverse decides internally which branch to run. In the SDK, the RecordCreated property tells your code which branch it chose. In the Web API, Prefer: return=representation lets you distinguish create from update through the response status code.

Learn more