Power Apps  

Entity Tag (ETag) in Power Apps – A Complete Guide

Introduction

In multi-user applications, one of the biggest challenges is preventing data conflicts. What happens if two users edit the same record at the same time? Who wins? Which data should be saved?

To solve this problem, Power Apps relies on a powerful mechanism called Entity Tag (ETag). Although developers rarely see it directly, ETag plays a critical role in maintaining data accuracy and consistency.

This article explains ETag in Power Apps from concept to implementation, with practical relevance for real-world projects.

What is an Entity Tag (ETag)?

An Entity Tag (ETag) is a unique version identifier attached to a record in a data source. It represents the current state of that record. Whenever a record is updated, its ETag changes automatically.

In simple terms:

ETag is a version stamp that tells Power Apps whether a record has changed since it was last read.

Why ETag is Important in Power Apps

Power Apps is often used in enterprise environments where:

  • Multiple users access the same data

  • Data is edited simultaneously

  • High data accuracy is required

ETag ensures

  • No accidental overwrites

  • Safe multi-user editing

  • Data consistency

  • Reliable conflict detection

It supports Optimistic Concurrency Control, assuming conflicts are rare but verifying before saving.

How ETag Works in Power Apps

Behind the Scenes Flow

  1. User opens a record
    Power Apps fetches:

    • Record data

    • Associated ETag (version)

  2. User edits data

  3. Another user modifies the same record → ETag changes

  4. Original user tries to save → Power Apps compares stored ETag with current ETag

If they don’t match → Power Apps blocks the update and raises a conflict.

ETag & Concurrency Control

Power Apps uses Optimistic Concurrency by default:

StepAction
ReadRecord + ETag captured
ModifyUser changes data
SaveETag compared
MismatchSave fails

This protects your system from silent data loss.

Data Sources That Use ETag

ETag is actively used in:

Data SourceConcurrency Mechanism
SharePointETag-based version control
DataverseRowVersion (ETag equivalent)
SQL ServerTimestamp / RowVersion
CDSVersion-based concurrency

Example Scenario

Two managers edit the same approval record.

  • Manager A changes status to "Approved"

  • Manager B changes status to "Rejected"

ETag ensures

  • The second save does not overwrite the first without awareness.

  • A conflict is raised instead.

Example in Power Apps

IfError(
   Patch(Tasks, ThisItem, { Status: "Completed" }),
   Notify("This record was modified by another user. Please refresh and try again.", NotificationType.Error)
)

The error occurs because ETag comparison failed.

Can Developers Access ETag?

Power Apps handles ETag internally:

  • You cannot directly read or set ETag

  • You can design logic around it using:

    • Refresh()

    • IfError()

    • Soft-locking mechanisms

Common ETag Error Messages

  • "The record has been modified by another user."

  • "The data source has changed since the record was retrieved."

  • "Concurrency conflict detected."

Best Practices to Handle ETag Conflicts

1. Always Handle Errors

IfError(
    SubmitForm(EditForm1),
    Notify("Data conflict detected. Please reload and try again.", NotificationType.Warning)
)

2. Refresh Before Save

Refresh(DataSource);
SubmitForm(EditForm1);

3. Implement Record Locking (Soft Lock)

Add fields:

  • IsLocked

  • LockedBy

  • LockedOn

Patch(List, ThisItem,
{
   IsLocked: true,
   LockedBy: User().Email
});

ETag vs RowVersion

ETagRowVersion
Logical version IDDatabase-level version
Used in SharePoint & APIsUsed in SQL Server
HTTP header-basedColumn-based

Both serve the same purpose: record version control.

Practical Impact in Power Apps

ETag ensures:

  • Reliable approval workflows

  • Secure transactional operations

  • Conflict-free collaborative editing

  • Enterprise-grade data handling

Without ETag, Power Apps would risk:

  • Data overwriting

  • Loss of critical updates

  • Corruption of business processes

Summary

Entity Tag (ETag) in Power Apps

  • Is a hidden version identifier for records

  • Enables optimistic concurrency control

  • Prevents accidental data overwrite

  • Ensures safe multi-user collaboration

It operates silently but forms the backbone of secure and reliable data management.

Final Thought

Understanding ETag allows Power Apps developers to build robust, conflict-free, and scalable applications. While invisible, its effect is felt every time multiple users interact with shared data.