Skip to main content

Notifications

Power Platform Community / Forums / Power Query / Patch related datavers...
Power Query
Suggested answer

Patch related dataverse column in a Model Driven App

Posted on by 1,133
 
Hi,
 
Does anybody have some examples on how I can achieve this?
 
I am trying to create a Patch statement that duplicates a related record but can't work out how to get the column that actually creates the relationship link?
 
Whilst the answer to my previous post is here https://community.powerplatform.com/forums/thread/details/?threadid=ff9f3da6-f281-ef11-ac20-7c1e520187c4 it didn't quite answer and won't let me respond to the suggested answer.
 
When I go to add the Table that I need to perform the lookup on, the auto suggest doesn't even list it as an option. (as per screenshot below
 
 
This is the attempt ate a believe should work
 
Patch(
'Quote Line Item Calcs',
Defaults('Quote Line Item Calcs'),
{'Product Cost':Self.Selected.Item.'Product Cost',
'Quote Line Item': LookUp('Quote Line Items', Name = Self.Selected.'Quote Line Item')
})
 
but is throwing error "Name isn't valid" for all 3 issues (table name, column name for related table and column name for this table.
 
 
Thanks
 
Todd
  • Suggested answer
    Nandit Profile Picture
    Nandit 1,091 on at
    Patch related dataverse column in a Model Driven App
    Hi Tango,
     
    I am back! :D
     
    You need to make sure the Dataverse table is a part of your app. If yes, then refresh it, save & publish, close and reopen (if you have not already tried this, it helps).
    Can we try the following please:
    Patch(
    'Quote Line Item Calcs',
    Defaults('Quote Line Item Calcs'),
    {'Product Cost':Self.Selected.Item.'Product Cost',
    'Quote Line Item': LookUp('Quote Line Item Calcs', ID = Self.Selected.Item.ID).'Quote Line Item'
    //you can replace with the ID column in your table
    })
    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!
     

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

September 2024 Newsletter…

September 2024 Community Newsletter…

Community Update Sept 16…

Power Platform Community Update…

Tuesday Tip #2 Global Search…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 142,008

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,531

Leaderboard

Featured topics