Introduction

When building canvas apps in Power Apps, developers often get confused between Patch and UpdateIf, especially when updating records in data sources like SharePoint or Dataverse.

Although both functions are used to update data, they serve different purposes and behave differently.

This article explains the difference, syntax, best use cases, and real examples for Patch and UpdateIf—so you can choose the right function for your scenario.

What is Patch?

Patch() is a record-based function.
It is used to create, update, or merge a single record or multiple fields of a record.

Key points of Patch

Patch Syntax

Patch(
    DataSource,
    RecordToUpdate,
    {
        Column1: Value1,
        Column2: Value2
    }
)

Example of Patch

Update the Status of a specific record:

Patch(
    'Expense List',
    LookUp('Expense List', ID = varSelectedID),
    { Status: "Approved" }
)

Creates a new record:

Patch(
    'Expense List',
    Defaults('Expense List'),
    {
        Title: txtTitle.Text,
        Amount: Value(txtAmount.Text),
        Status: "Pending"
    }
)

What is UpdateIf?

UpdateIf() is a condition-based function.
It updates all records that match a condition—similar to running an update query.

Key points of UpdateIf

UpdateIf Syntax

UpdateIf(
    DataSource,
    Condition,
    {
        Column1: Value1,
        Column2: Value2
    }
)

Example of UpdateIf

Update all expenses where Status = “Pending” to “In Review”:

UpdateIf(
    'Expense List',
    Status = "Pending",
    { Status: "In Review" }
)

Increase Amount for all records created today:

UpdateIf(
    'Expense List',
    DateValue(Created) = Today(),
    { Amount: Amount + 100 }
)

Which One Should You Use?

Use Patch when:

Use UpdateIf when

Conclusion

Both Patch and UpdateIf are powerful tools, but they are designed for different purposes:

Choosing the right function improves performance, maintains data integrity, and simplifies your app logic.