PATCH A SharePoint LookUp Column In Power Apps



Goal

Change the BranchLocationLookUp column (Lookup Type) from “Fargo, ND” to “Minneapolis, MN” in a SharePoint List


Input

Site Inspections (SharePoint List)

IDInspectionNameDateBranchLocationLookUp
1Quality Audit11/7/2020Fargo, ND



Branch Locations (SharePoint List)

IDBranch Location
1Fargo, ND
2Minneapolis, MN


Patch Function Code
Patch( 'Site Inspections', LookUp('Site Inspections', ID=1), { BranchLocationLookUp: { Id: 2, Value: "Minneapolis, MN" } } )Code language: JavaScript (javascript)



Alternate Code

Patch( 'Site Inspections', LookUp('Site Inspections', ID=1), { BranchLocationLookUp: { Id: 2, Value: LookUp('Branch Locations', ID=2, Title) } } )Code language: JavaScript (javascript)


Output

Site Inspections (SharePoint List)

IDInspectionNameDateBranchLocationLookUp
1Quality Audit11/7/2020Minneapolis, MN




Scenario #1: Combo Box

Patch a value found in a combo box to a Lookup field.



Patch Function Code
Patch( 'Site Inspections', LookUp('Site Inspections', ID=1), { BranchLocationLookUp: ComboBox_BranchLocation.Selected } )Code language: JavaScript (javascript)