Showing results for 
Search instead for 
Did you mean: 
Kudo Kingpin
Kudo Kingpin

How can I Patch a value into a lookup Column in a Sharepoint List or Doc library?

I have a Sharepoint List called "Expenses" and a Document library called "Receipts", which has a lookup column to Expenses Title column.


I am able to display the contents of the Receipts Document library in a Gallery (let's say it's called GalleryReceipts), I can filter the gallery no problem, showing only documents that are associated with the current Selected Expense (from GalleryExpenses) or the Lookup field (ExpensesRef) is Blank.


I have inserted Checkboxes into GalleryReceipts and want to Patch the value from Expenses Title into the lookup Column (ExpensesRef) in the Doc library.


Thanks to @Meneghino I have the Fomula to patch all the "selected" items from the GalleryReceipts, however I get an error when trying to patch to a lookup column, to the effect "expected record, found number".


I tried ExpensesRef.value:GalleryExpenses.selected.Title but that doesn't work.


Any help would be greatly appreciated.

Community Champion
Community Champion

Hi @UB400

Please have a look here.

It is a little bit dated, but should work unless the PA team have made changes to the SP connector that break this work-around.

@MeneghinoThank you for responding, I tried your suggestion, this is what I tried:


1. I have a "Master" List called TA

2. I have a Doc library in the same SP Site called TAAttachments

3. I inserted a Lookup column in the Doc library, the name of the Lookup Column is TARefID, which looks up the ID in the Master list


Here's the code I tested with


 Patch(TAAttachments,First(Filter(TAAttachments,ID=GalleryTAAttachments_1.Selected.ID)),{TARefID: {Id:1, Value:93,  '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference"}})


Image below is the error message I got




Any suggestions?

Helpful resources

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Check out the Power Apps Community Call for January 2021

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.


Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (9,485)