Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

How to patch a SharePoint Lookup Column

I can update all other SharPoint fields using the Patch function, but I am unsucessful in udpating lookup columns using a button.


I have a Customers list and a Projects list and I am trying to patch the ID of the Customer into the Projects list which has a lookup column to the Customers list ( column ID).


This is my function which is connected to the button -


Patch(Projects,{Title: Gallery.Selected.Title, CustomerID: Gallery.Selected.ID})


The error message I get is 'The type of this record does not match the expected type 'Record.' Found type 'Number'.


Well, I tried and I just couldn't get it to work.  So I decided on a diffrent strategy.   Instead of trying to set it to blank, set it to a default value and then enter that default value into the source table the lookup column is based on.  Works like a charm...

hello, @v-micsh-msft 


I have a simular case. (Patch to lookup columns in sharepointlist.) 

The user selects an item in the browsegallery and he will be navigate to an editform. 

Because I changed the item function of the dropdowns in the editform, the submitform function doesn't work any more. (I suppose that's the reason. )  


I tried to use your formula but there is still something wrong. This is what I use on the onselect function from an icon (to save) 

A second question is how to use it for multiple dropdowns. This editform has 4 dropdowns each to patch to a lookup column.



Navigate('Screen CMT NIV 3';ScreenTransition.None) ;;
Patch('CMT Niveau 3';
'BrowseGallery CMT Niv3'.Selected; 
Id:'BrowseGallery CMT Niv3'.Selected.Id;
Value:'BrowseGallery CMT Niv3'.Selected.'B-TO'.Value }

I figured out to Filter The choices of the dropdown based on the value in another list. 

Then I could use submitform again and i don't have to patch. 



I know this thread is many years old, but in googling the issue it was still the first hit. I think the available solutions have improved since this discussion happened. It seems the original solution is constructing a record meant to match the lookup. Instead of doing that, you can lookup the actual record.


Patch(Projects, Lookup(Projects, Gallery.Selected.ID, ID.Value = Gallery.Selected.ID, Project));


This should work for both Sharepoint Lookup columns and Sharepoint Choice columns. For Choice columns, this is your only option because the records only exist inside this column in the larger list. For Lookup, you could also instead lookup directly from the lookup list.

Not applicable

Hi @v-micsh-msft!


I am currently trying to patch a column on sharepoint that is a yes or no choice column. If the button is clicked, I want the column on sharepoint to output a yes. 

Currently, my unfinished code is: Patch('Routings Needed',LookUp('Routings Needed',ID=DataCardValue7), {'BOM Reviewed?': {

Where I want the ID is based on a unique ID in powerapps. How could I finish this code?

Thank you in advance for your help.

What if i want to clean those Fields?


For example, i have a button with a patch and i want to delete the info that's already on the record
Patch( tbl01PC; LookUp(tbl01PC;Hostname="MEXD000038"); {DirCuentaAD:{Id:"What do i have to put in here?"; Value:"What do i have to put in here?"; '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference"}})


Please help.

It's notoriously difficult to blank a sharepoint field from a powerapp. Here's a discussion about blanking a user field.


For this one, I would have a value that you treat as blank, maybe -


I just looked at the post and i tried with:

Patch(tbl01PC;LookUp(tbl01PC;Hostname=GalleryEAS.Selected.Hostname);{DirCuentaAD:{Id:-1; Value:""; '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference"}})


And it worked perfectly.


Helpful resources

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (7,727)