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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Add related column fro...
Power Apps
Unanswered

Add related column from lookup for Patch statement

(1) ShareShare
ReportReport
Posted on by 1,164
Hi,
 
I have a use case where I need to Clone an Associated Item (Quote Line Item Calc Table). This is inside a Grid that sits on a form. Main Table is Quote Line Item.
 
Linking the 2 is 
 
The column is not even being used in the raw table.
 
 
What I am not quite sure on is how to add the lookup column (linking column) to the patch statement. Do I need to look it up first? It's displayed in the form. 
 
 
My 1st attempt, thanks to some assistance on this forum will be something like 
 
ForAll(
Self.Selected.AllItems,
Patch(
'Quote Line Item Calcs',
Defaults('Quote Line Item Calcs'),
{
'Quote Line Item':ThisRecord.'Quote Line Item',
'Product Cost':ThisRecord.'Product Cost'
}
)
)
 
However error I am getting on the formula is "invalid argument type (guid). Expecting a record value instead"
 
Thanks in advance for any assistance on this one.
Categories:
I have the same question (0)
  • Suggested answer
    Nandit Profile Picture
    1,568 Moderator on at
    Hi Tango,
     
    To patch LookUp columns, you'll need to provide a record using lookup.
    Also are you trying to patch all the items in a gallery?
     
    Update your formula to something like this:
    ForAll(
    Gallery.AllItems,
    Patch(
    'Quote Line Item Calcs',
    Defaults('Quote Line Item Calcs'),
    {
    'Quote Line Item': LookUp('Quote Line Item', ID = 1), //or any other way of getting the correct record
    'Product Cost':ThisRecord.'Product Cost'
    }
    )
    )
    Hope this helps. 
     
    Kind regards, 
    Nandit
     
    If this answers your query, please mark this response as the answer.
    If its helpful, please leave a like. Thanks!
  • Tango Profile Picture
    1,164 on at
    Thanks for your response @Nandit but can quite understand how to expand this to not look for an id of 1 but the current record that is open

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard