cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
GaryHounslow
Level: Powered On

Patching to Sharepoint Lookup Column

Good morning,

I have been googling for some time now with no success on this query

 

My apps datasource is a Sharepoint list and one of the fields that I would like to patch from Powerapps is a Lookup Column.

 

I have seen that the Syntax for this requires an ID but I dont know what to put in there.  Within the app it is just a Form for submitting new records so in theory at this stage there is no ID until the record is created.

 

Im confused...

 

Anybody done this before?

 

Gary

1 ACCEPTED SOLUTION

Accepted Solutions
GaryHounslow
Level: Powered On

Re: Patching to Sharepoint Lookup Column

Thanks for the response, my solution was as below:

 

'Product Purchased': {'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference", Id: DataCardValue3.Selected.Id, Value: DataCardValue3.Selected.Value},

 

So the ID is the same as the selected value.

 

Gary

4 REPLIES 4
GaryHounslow
Level: Powered On

Re: Patching to Sharepoint Lookup Column

Ignore this post, all sorted now.  Its not the ID of the item that is being created, it is the ID of the value from the lookup source.

Super User
Super User

Re: Patching to Sharepoint Lookup Column

@GaryHounslow 

 

Can you try out the below expression:

Patch(MyTestList12,Defaults(MyTestList12),{Title:TextInput1.Text,LookUpCol:LookUp(Choices(MyTestList12.LookUpCol),Value=TextInput1_1.Text)})
Here, MyTestList12 is the name of my SharePoint List and LookUpCol is the lookup attribute in this list.
 
Also, regarding the ID, since we have to pass the ID for LookUp item so this will be already be existing. The newly generated ID would be for the record in main table. Choices() function return lookup value along with the ID so no need to enter it separately.
 
Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
GaryHounslow
Level: Powered On

Re: Patching to Sharepoint Lookup Column

Thanks for the response, my solution was as below:

 

'Product Purchased': {'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference", Id: DataCardValue3.Selected.Id, Value: DataCardValue3.Selected.Value},

 

So the ID is the same as the selected value.

 

Gary

Super User
Super User

Re: Patching to Sharepoint Lookup Column

Hey @GaryHounslow 

 

My Bad, I read your next message after posting my response. And yes, that's another way to patch the lookup column, Please mark this thread as solved if your issue is resolved now, this will help others having the same problem too.

 

 

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Users Online
Currently online: 289 members 5,012 guests
Please welcome our newest community members: