web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Patch to a SharePoint ...
Power Apps
Answered

Patch to a SharePoint Lookup Column

(0) ShareShare
ReportReport
Posted on by 230

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

Categories:
I have the same question (0)
  • Verified answer
    MarcBailey Profile Picture
    230 on at

    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...

  • skmcken Profile Picture
    320 on at

    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}})

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 494

#2
WarrenBelz Profile Picture

WarrenBelz 352 Most Valuable Professional

#3
11manish Profile Picture

11manish 323

Last 30 days Overall leaderboard