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 / Look up column issue w...
Power Apps
Answered

Look up column issue while patching

(0) ShareShare
ReportReport
Posted on by 262

I am trying to give column name called "class" which is employee list

this class column comes from list called class. 

But while patching I get the error though I have given correct details in the formulae. Please help what is wrong here. I have attached screenshots

and to recognize look up column in patching do we need to give IDS? is it mandatory?  

t1.PNG
t3.PNG
t2.PNG
Categories:
  • Coopedup Profile Picture
    355 on at

    The attachments will not open...maybe try cut/pasting them again!

  • yougan Profile Picture
    262 on at

    yougan_0-1609412829481.png

    yougan_1-1609412851276.png

     

    yougan_2-1609412869317.png

     

  • Jitendra_jangid Profile Picture
    128 on at

    Class appears to be a lookup column. Update it like below

     {Class:{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
     Id:1,
     Value:"Class1"}
     }
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    Heh, another reason not to use SharePoint lookup columns.

  • WarrenBelz Profile Picture
    156,526 Most Valuable Professional on at

    @yougan ,

    Just adding to adding to @Drrickryp 's comments, unless you want your users to use SharePoint directly in a Datasheet bulk edit, there is absolutely no reason to have Lookup columns and they will cause you a whole heap of completely unnecessary complication and limitations (Delegation and Filters in particular). Shane Young @Shanescows has made a good video on this.

    Apart from this, @Jitendra_jangid 's code below is correct if you want to "hard code" values, but I assume you are wanting to get the value dynamically when a user chooses an item? Also note Id and not ID is used here.

    {
     Class:
     {
     '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
     Id:1,
     Value:"Class1"}
     }
    }

    In case, you need to get the Id of the actual item of the value chosen as it is actually the Id that is being patched primarily - it is the ID of the item in the other list you have looked up.

     

  • yougan Profile Picture
    262 on at

    Hi All,

     

    Thank you all. Noted. 

    I am not clear on how to declare this look up, I tried to add class column and its value as per your suggestion, but coming up with below warning/error message. Please help

     

    and one more note I am trying to give manager in patch function. Manager is people picker column giving below error message though I gave all correct values

    mg.PNG
    qq.PNG
  • Verified answer
    WarrenBelz Profile Picture
    156,526 Most Valuable Professional on at

    @yougan ,

    Looking first at the syntax, you have an extra bracket before Class

    ClassBracket.PNG

    It should be

    Patch(
     Employee, 
     Defaults(Employee), 
     {
     Title : "666", 
     Favoritecolor : {Value : "Orange"},
     Class:
     {
     '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
     Id:1,
     Value:"Classl"
     }
     }
    )

    but that is not the real issue if you are going to be selecting Class from a drop-down or such and then Patching the result back to the SharePoint Lookup column. In its simplest form, if you had a dropdown (I will call it ddClass below) with the Items

    Choices([@Employee].Class)

    which is the way Power Apps would create it, then your Class part of the Patch would be

    Class:
    {
     '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
     Id:ddClass.Selected.Id,
     Value:ddClass.Selected.Value
    }

    If however you have sourced the Items differently, then it gets more complex getting the correct Id to Patch back.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 402 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 296 Most Valuable Professional

Last 30 days Overall leaderboard