Power Apps examples
Power Apps Patch examples for SharePoint and Dataverse
Practical Patch examples for choice fields, people fields, lookups, validation, and safe save behavior.
Power Apps Patch examplesPatch SharePoint Power AppsPatch Dataverse Power Apps
When to use this
Use these examples when you need a reliable save formula that handles validation, user feedback, and the field shapes Power Apps expects.
Implementation steps
- Validate required controls before saving.
- Patch field records in the shape expected by the connector.
- Wrap important saves in IfError.
- Capture the saved record when later steps need the ID.
Starter example
Formula / code
IfError(
Set(
varSavedRequest,
Patch(
Requests,
Defaults(Requests),
{
Title: txtTitle.Text,
Priority: { Value: cmbPriority.Selected.Value },
AssignedTo: {
Claims: "i:0#.f|membership|" & Lower(cmbAssignee.Selected.Mail),
DisplayName: cmbAssignee.Selected.DisplayName,
Email: Lower(cmbAssignee.Selected.Mail),
Department: "",
JobTitle: "",
Picture: ""
}
}
)
);
Notify("Request " & varSavedRequest.ID & " saved.", NotificationType.Success),
Notify("The request could not be saved.", NotificationType.Error)
);FAQ
Can I copy this example directly?
Use it as a starting point, then adjust data source names, column names, permissions, and validation for your tenant.
Should this be tested before production?
Yes. Test with realistic records, non-admin users, edge cases, and expected data volume before release.
Common mistakes
- Patching complex SharePoint fields as plain text.
- Skipping IfError on production save buttons.
- Testing only with the maker account.
- Forgetting to disable double-submit behavior.