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 look up column i...
Power Apps
Answered

patch look up column in sharepoint list with attachment not working properly

(0) ShareShare
ReportReport
Posted on by 130

Hi All,

I have a SP list in which I want to patch a column using look up with attachment.

My code: 
Patch(
SPList,
LookUp(
SPList,
OrderID = Gallery4_6.Selected.OrderID
),
{
'Column':TextInput17.Text
},FormUpdates
);

I'm using form.updates to patch attachments.

Now the thing is when I run above code it does not patch those lookup columns but patch attachments. And when I remove form.updates it successfully patches the look up columns.

How to patch both lookup columns and attachments.

I tried this Patch code as well(using two patch function(with and without form.updates):
Patch(
SPList,
LookUp(
SPList,
OrderID = Gallery4_6.Selected.OrderID
),
{
},

FormUpdates
);


Patch(
SPList,
LookUp(
SPList,
OrderID = Gallery4_6.Selected.OrderID
),
{
'Column':TextInput17.Text
}
);



still above code doesn't work properly.

Please help!!!!

Thanks,
Rahul

Categories:
  • Verified answer
    r_voyager Profile Picture
    130 on at

    I managed to resolve it by using Select() function.

    On first button I patched look up column and used button2 in select, so on clicking first button second button will also get pressed.

    And second button has the code to patch attachments.

    Here is the code for button1:
    Patch(
    SPList,
    LookUp(
    SPList,
    OrderID = Gallery4_6.Selected.OrderID
    ),
    {
    'Column':TextInput17.Text
    }
    );
    Select(Button2);

    Button2 code:

    Patch(
    SPList,
    LookUp(
    SPList,
    OrderID = Gallery4_6.Selected.OrderID
    ),
    {
    },

    FormUpdates
    );

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 381 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 340

#3
WarrenBelz Profile Picture

WarrenBelz 187 Most Valuable Professional

Last 30 days Overall leaderboard