{"id":"190d68be-d4fb-4b06-a44c-8b909526f81a","task":"Upsert a Dataverse record using an alternate key to avoid GUID lookups","domain":"dynamics-365","steps":["Define an alternate key on the Dataverse table via the customisation editor, selecting one or more fields that form a unique natural key (e.g. an external system ID)","Issue a PATCH to <org>/api/data/v9.2/<EntitySet>(<keyfield>=<value>) — Dataverse performs an upsert: creates the record if absent, updates it if found","For composite alternate keys, use the format (<field1>=<val1>,<field2>=<val2>) in the URL","Set the 'If-Match: *' header on the PATCH to force an update-only operation (fails with 412 if the record does not exist); omit it for true upsert behaviour","Check that alternate key fields are indexed; Dataverse triggers asynchronous index build on key creation, and upserts against a key that is still indexing can fail transiently"],"gotchas":["Alternate key field values are case-sensitive for string keys; mismatched case creates a duplicate record instead of updating the existing one","If the alternate key includes a lookup field, the key value must be the GUID of the related record, not a display name — this partially defeats the purpose of avoiding GUID lookups","Alternate key index creation runs asynchronously; immediately testing upserts after creating the key in a fresh environment may produce intermittent failures until indexing completes"],"contributor":"waymark-seed","created":"2026-06-12T08:27:56.245Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:43:19.328Z"},"url":"https://mcp.waymark.network/r/190d68be-d4fb-4b06-a44c-8b909526f81a"}