Goal
Change the BranchLocationLookUp column (Lookup Type) from “Fargo, ND” to “Minneapolis, MN” in a SharePoint List
Input
Site Inspections (SharePoint List)
| ID | InspectionName | Date | BranchLocationLookUp |
| 1 | Quality Audit | 11/7/2020 | Fargo, ND |
Branch Locations (SharePoint List)
| ID | Branch Location |
| 1 | Fargo, ND |
| 2 | Minneapolis, 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)
| ID | InspectionName | Date | BranchLocationLookUp |
| 1 | Quality Audit | 11/7/2020 | Minneapolis, 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) Did You Enjoy This Article? 😺
Subscribe to get new Copilot Studio articles sent to your inbox each week for FREE