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 / How to patch a SharePo...
Power Apps
Unanswered

How to patch a SharePoint LookUp column?

(0) ShareShare
ReportReport
Posted on by 180

Hey there, I have spent 3+ hours on it so far + read countless topics and blog posts, but I can't get my Patch to work.

 

I have 2 tables: Table called Orders and a table called Employees.

In the app people can insert orders and the Employees can either approve or decline the order.

 

I have a field called "Rejected by" which is a LookUp column in my Orders table. It does a LookUp to the Employees table. The tables look like this:

 

Employees:

E-mailName
john.doe@gmail.comJohn Doe
mike.tyson@outlook.comMike Tyson

 

Orders:

ProductAmountCreated DateStatus (Choice)Rejected by (LookUp)
iPhone316/03/2022Pending 
Samsung Galaxy414/03/2022RejectedJohn Doe

 

I tried the following:

Patch(
 Orders,
 LookUp(Orders, Id = Value(DataCardValue_ID.Text)),
 {
 'Rejected by': {
 Id: LookUp(Employees, 'E-mail' = User().Email).Id,
 Value: LookUp(Employees, 'E-mail' = User().Email).Name
				}
 }
);

 And multiple variations of it, but I can't get it to work. Does someone know how to do this?

I get the following error:

Gjakova_0-1647452593153.png

Kind regards

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    155,723 Most Valuable Professional on at

    Hi @Gjakova ,

    Maybe this

    Patch(
     Orders,
     {ID:Value(DataCardValue_ID.Text)},
     {
     'Rejected by': 
     {
     Id: LookUp(Employees,'E-mail' = User().Email).ID,
     Value: LookUp(Employees,'E-mail' = User().Email).Name
     }
     }
    );

     

    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.

    Visit my blog Practical Power Apps

  • Gjakova Profile Picture
    180 on at

    Nope, unfortunately the same error... 😞

  • WarrenBelz Profile Picture
    155,723 Most Valuable Professional on at

    @Gjakova ,

    Can you please show me your field definition for 'Rejected by'

  • Gjakova Profile Picture
    180 on at

    Sorry, I think I don't understand it quite well, but what do you mean with field definition? It is just a LookUp column to my Employees table. Basically if you create those two sample tables in SharePoint, there is a high chance you will come across the same error as I have... 😞

  • WarrenBelz Profile Picture
    155,723 Most Valuable Professional on at

    @Gjakova ,

    I just need to see a screen shot in the List Settings of your field to see what it is looking up and where and what type of field it is. If you are looking up the field Name in Employees where the 'E-mail' field matches the user's email AND this is a Single Line of Text AND the User's email is in the list, then the code should work. Is all of this correct?

  • stayinginsync Profile Picture
    139 on at

    I found this YouTube demo and it really helped me solve my Patch-to-SharePoint issues:

     

    https://youtu.be/wDKuLeK9N9Q

     

    ------------------------------------------------------

    Find this useful? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below.

    Others seeking the same answers will be happy you did.

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 481

#2
WarrenBelz Profile Picture

WarrenBelz 379 Most Valuable Professional

#3
11manish Profile Picture

11manish 291

Last 30 days Overall leaderboard