I’m trying to implement safe concurrent editing in a custom Power Pages questionnaire
Multiple authenticated respondents may work on different parts of the same questionnaire at the same time, and I want to prevent silent overwrites if two users happen to edit the same Dataverse record.
The relevant custom Dataverse table is named: at_fq_answer
Optimistic concurrency is enabled for this table. I verified it in a model-driven app using:
With result: true, Power Pages Web API GET also returns ETags correctly.
For example: GET /_api/at_fq_answers(<id>)?$select=at_fq_answerid,at_value_text_short returned: @odata.etag: W/"5403465"
I then performed a PATCH using this exact ETag:
with payload:
The request succeeded: 204 No Content
A subsequent GET confirmed that the record was updated and that the ETag changed:
Then I deliberately sent another PATCH using the original stale ETag:
with a different payload:
I expected: 412 Precondition Failed However, Power Pages returned: 204 No Content
and a final GET confirmed that the stale request actually overwrote the newer value: FINAL VALUE: ETAG TEST - USER B STALE,
So this does not look like only a response-code issue - the newer value was overwritten. I tested this using both: webapi.safeAjax and native: fetch() against the Power Pages /_api endpoint, with the same result.
I also verified in browser DevTools → Network that the stale If-Match header is actually present in the outgoing PATCH request:
So from the browser side, the version-specific If-Match header is definitely being sent.
My questions are:
- Does the Power Pages Web API
/_api endpoint officially support Dataverse optimistic concurrency using version-specific If-Match headers?
- Is there any additional Power Pages site setting, Web API setting, table permission setting, or other configuration required for stale ETags to return
412 Precondition Failed?
- Does the Power Pages Web API proxy intentionally strip, replace, or ignore version-specific
If-Match values before forwarding the request to Dataverse?
- If this behavior is not supported in Power Pages Web API, what is the recommended pattern for preventing lost updates in a multi-user Power Pages application?
The desired behavior is:
User A loads record with ETag W/"1" User B loads record with ETag W/"1" User A saves → succeeds → record becomes ETag W/"2" User B saves with If-Match: W/"1" → should fail with 412 → User A's changes should remain intact
Any confirmation on whether this scenario is supported through Power Pages /_api would be greatly appreciated.
Thanks!