Data source

Patch

Creates or updates a record in a data source, or merges records.

Syntax

Patch(DataSource, BaseRecord, ChangeRecord1 [, ChangeRecord2, ...])

Parameters

DataSource
The table or list to change.
BaseRecord
The record to update, or Defaults(DataSource) to create one.
ChangeRecord
The columns and values to set.

Examples

  1. Patch(Tasks, Defaults(Tasks), { Title: txtTitle.Text, Status: "New" })

    Creates a task

  2. Patch(Tasks, ThisItem, { Status: "Done" })

    Updates the selected task

Maker notes

  • Returns the saved record, so you can store it with Set to get generated IDs.
Official documentation on Microsoft Learn

↑ ↓ moveEnter open