Question

How to update using patch in SharePoint list from edit form?

Using below patch function. but, its creating new record every time.

Patch(test, Defaults('test'),
  {
    ReasonforLateSubmission: DataCardValue201_2.Text,
    WorkDescription: DataCardValue202_2.Text,
    OtherBusinessJustification: DataCardValue206_2.Text,
    DetailedWorkDescription: DataCardValue203_2.Text,
    WorkRequestJustification: DataCardValue204_2.Text,
    Title: DataCardValue210_2.Text

  }
);
Était-ce utile?

La solution

You need to pass ID of list item as a BaseRecord for update operation.

Syntax:

Patch( DataSource, BaseRecord, ChangeRecord1 [, ChangeRecord2, … ])
  • DataSource – Required. The data source that contains the record that you want to modify or will contain the record that you want to create.
  • BaseRecord – Required. The record to modify or create. If the record came from a data source, the record is found and modified. If the result of Defaults is used, a record is created.
  • ChangeRecord(s) – Required. One or more records that contain properties to modify in the BaseRecord. Change records are processed in order from the beginning of the argument list to the end, with later property values overriding earlier ones.

Source: Patch - Syntax.

Also, check the examples given at Patch - Updates.

OR the excellant video tutorial given at: PowerApps Patch Function.

Licencié sous: CC-BY-SA avec attribution
Non affilié à sharepoint.stackexchange
scroll top