cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MarcBailey
Level 8

Patch to a SharePoint Lookup Column

I could really use some help on this one.  Thanks, Marc

 

SharePoint Lookup Column does not update when executing the following Patch code from OnSelect of ListBox:

(The code does not show any errors.)

 

Patch(AcctMain,First(Filter(AcctMain,ID=CurrentAcctID)),{AcctStatus:{ '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",Id:Value(CurrentAcctID),Value:ListBox2_39.Selected.Value}})

 

AcctMain is SharePoint list that contains the Lookup column AcctStatus

CurrentAcctID is a global variable for the selected ID

 

AccountDetailsPatch.JPG

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
MarcBailey
Level 8

Re: Patch to a SharePoint Lookup Column

I think I have figured it out by switching from a ListBox to a Gallery.  The ListBox did not provide for Id column.  I was able to use the Gallery and include Id, Title, and DisplayName.  Id and Title are required in the syntax and I needed DisplayName to properly display my Items.  I made Visible: false for Id and Title.

 

If anyone has any different insight or suggestions - please post.

 

Thanks, Marc...

View solution in original post

2 REPLIES 2
Highlighted
MarcBailey
Level 8

Re: Patch to a SharePoint Lookup Column

I think I have figured it out by switching from a ListBox to a Gallery.  The ListBox did not provide for Id column.  I was able to use the Gallery and include Id, Title, and DisplayName.  Id and Title are required in the syntax and I needed DisplayName to properly display my Items.  I made Visible: false for Id and Title.

 

If anyone has any different insight or suggestions - please post.

 

Thanks, Marc...

View solution in original post

skmcken
Level 8

Re: Patch to a SharePoint Lookup Column

You could still use the List Box but, you would would make use of a lookup reference as well:  -

 

Patch(AcctMain,First(Filter(AcctMain,ID=CurrentAcctID)),{AcctStatus:{ '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",Id:Value(CurrentAcctID),Value:Lookup(DATASOURCE, StartsWith(ACCTStatus, ListBox2_39.Selected.Value).ID}})

 

 

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (4,664)