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 update lookup f...
Power Apps
Unanswered

How to update lookup field

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi

I'm trying to update a SharePoint List from a collection.

The SharePoint list has one lookup field.

So, when I'm collecting the items, I'm using the following code:

 

Collect(NoChargeItems,CollectionItems);

 

 

When I'm submitting the collection to add record to SharePoint, I'm using the following code:

 

Collect(
 CollectionItems,
 {
 ItemRequestID: DCValueRequestID.Text,
 ItemSMN: TextInputMaterialNumber.Text,
 ItemReference: TextInputItemReference.Text,
 ItemDescription: TextInputItemDescription.Text,
 ItemQTY: DropdownQTY.Selected.Value,
 ItemSpecialInstructions: TextInputSpecialInstruction.Text,
 LinkedRequestID: {Value:DCValueRequestID.Text} // THIS IS THE LOOKUP FIELD THAT I WANT TO UPDATE
 }
);

 

 

My problem is that the lookup field doesn't get updated. The lookup field (LinkedRequestItem) value comes from a TextInput field that I have in a form.

 

 

Categories:
  • zmansuri Profile Picture
    6,048 Super User 2024 Season 1 on at

    Lookup and Choice and People picker this are complex type columns. You can't patch it directly because it is not a value but the record itself.

    Check this out:

    Solved: How to patch a SharePoint Lookup Column - Power Platform Community (microsoft.com)

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thanks @zmansuri 

    I saw this article. This article shows how to patch in case you have data coming from dropbox or combo box. The value I want to update the lookup field with comes from TextInput field. How would this work in this case?

     

  • zmansuri Profile Picture
    6,048 Super User 2024 Season 1 on at

    Collect(
    CollectionItems,
    {
    ItemRequestID: DCValueRequestID.Text,
    ItemSMN: TextInputMaterialNumber.Text,
    ItemReference: TextInputItemReference.Text,
    ItemDescription: TextInputItemDescription.Text,
    ItemQTY: DropdownQTY.Selected.Value,
    ItemSpecialInstructions: TextInputSpecialInstruction.Text,
    LinkedRequestID: {

    '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",

    Id:DCValueRequestID.Text,

    Value:DCValueRequestID.Text}
    }
    );

     

    ================================================== OR Maybe this. Not Sure

    Collect(
    CollectionItems,
    {
    ItemRequestID: DCValueRequestID.Text,
    ItemSMN: TextInputMaterialNumber.Text,
    ItemReference: TextInputItemReference.Text,
    ItemDescription: TextInputItemDescription.Text,
    ItemQTY: DropdownQTY.Selected.Value,
    ItemSpecialInstructions: TextInputSpecialInstruction.Text,
    LinkedRequestID: {

    '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",

    Value:DCValueRequestID.Text

    }
    }
    );

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @zmansuri  unfortunately none of them worked, though the code didn't show any errors, but the field didn't update. It kept empty.

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 271

#3
Mohsin Ali Profile Picture

Mohsin Ali 239

Last 30 days Overall leaderboard